Check for systemd service and stop before installing

This commit is contained in:
DeathByDenim 2022-02-06 13:07:04 -05:00
parent 36121c82ae
commit 38dd289eb5
8 changed files with 32 additions and 0 deletions

View File

@ -1,6 +1,10 @@
#!/bin/bash
set -e
if [ -e /etc/systemd/system/hedgewars.service ]; then
systemctl stop hedgewars
fi
# Hedgewars
# Create SystemD unit
cat > /etc/systemd/system/hedgewars.service <<EOF

View File

@ -1,6 +1,10 @@
#!/bin/bash
set -e
if [ -e /etc/systemd/system/mindustry.service ]; then
systemctl stop mindustry
fi
# Mindustry
mkdir -p /opt/mindustry-v${mindustry_version}
curl --location https://github.com/Anuken/Mindustry/releases/download/v${mindustry_version}/server-release.jar > /opt/mindustry-v${mindustry_version}/mindustry.jar

View File

@ -1,6 +1,10 @@
#!/bin/bash
set -e
if [ -e /etc/systemd/system/openhv.service ]; then
systemctl stop openhv
fi
# Install OpenHV
mkdir -p /opt/openhv-${openhv_version}
curl --location "https://github.com/OpenHV/OpenHV/releases/download/${openhv_version}/OpenHV-${openhv_version}-x86_64.AppImage" > /opt/openhv-${openhv_version}/OpenHV-x86_64.AppImage

View File

@ -1,6 +1,10 @@
#!/bin/bash
set -e
if [ -e /etc/systemd/system/openspades.service ]; then
systemctl stop openspades
fi
# OpenSpades
mkdir -p /opt/openspades
virtualenv -p python3 /opt/openspades/env

View File

@ -3,6 +3,10 @@
echo "Installing SuperTuxKart ${stk_version}"
exit
if [ -e /etc/systemd/system/supertuxkart.service ]; then
systemctl stop supertuxkart
fi
# Install SuperTuxKart
stk_dir="/opt/SuperTuxKart-${stk_version}"
mkdir -p ${stk_dir}

View File

@ -1,6 +1,10 @@
#!/bin/bash
set -e
if [ -e /etc/systemd/system/teeworlds.service ]; then
systemctl stop teeworlds
fi
# Teeworlds
teeworld_directory="/opt/teeworlds-${teeworlds_version}"
mkdir -p ${teeworld_directory}

View File

@ -1,6 +1,10 @@
#!/bin/bash
set -e
if [ -e /etc/systemd/system/unvanquished.service ]; then
systemctl stop unvanquished
fi
# Unvanquished
unvanquished_directory="/opt/unvanquished-${unvanquished_version}"
curl --location "https://github.com/Unvanquished/Unvanquished/releases/download/v${unvanquished_version}/unvanquished_${unvanquished_version}.zip" > ${TMPDIR:-/tmp}/unvanquished.zip

View File

@ -1,6 +1,10 @@
#!/bin/bash
set -e
if [ -e /etc/systemd/system/xonotic.service ]; then
systemctl stop xonotic
fi
# Xonotic
xonotic_directory="/opt/xonotic-${xonotic_version}"
curl --location https://dl.xonotic.org/xonotic-${xonotic_version}.zip > ${TMPDIR:-/tmp}/xonotic.zip