Remove azuracast and startup commands
This commit is contained in:
parent
f6ee1d0466
commit
3a6916e1b3
2 changed files with 0 additions and 101 deletions
|
@ -1,63 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
if [ ! "$(whoami)" == "root" ]; then
|
|
||||||
echo "The soscmd-azuracast command must be ran as root user (superuser)."
|
|
||||||
/usr/bin/sudo -E /usr/bin/bash $0 $@
|
|
||||||
exit $?
|
|
||||||
fi
|
|
||||||
if [ "$1" == "help" ]; then
|
|
||||||
echo "soscmd-azuracast [help|start|stop|restart|update|cli|shell]"
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
cd /var/azuracast || exit 41
|
|
||||||
if [ "$1" == "start" ]; then
|
|
||||||
echo "::${AZURACAST_SPACES} Starting AzuraCast"
|
|
||||||
./docker.sh up
|
|
||||||
exit $?
|
|
||||||
elif [ "$1" == "stop" ]; then
|
|
||||||
echo "::${AZURACAST_SPACES} Stopping AzuraCast"
|
|
||||||
./docker.sh down
|
|
||||||
exit $?
|
|
||||||
elif [ "$1" == "restart" ]; then
|
|
||||||
echo "::${AZURACAST_SPACES} Restarting AzuraCast"
|
|
||||||
AZURACAST_SPACES="${AZURACAST_SPACES} " $0 stop
|
|
||||||
AZURACAST_SPACES="${AZURACAST_SPACES} " $0 start
|
|
||||||
echo "::${AZURACAST_SPACES} Restarted AzuraCast"
|
|
||||||
exit 0
|
|
||||||
elif [ "$1" == "update" ]; then
|
|
||||||
echo "::${AZURACAST_SPACES} Updating AzuraCast"
|
|
||||||
#env AZURACAST_SPACES="${AZURACAST_SPACES} " $0 stop
|
|
||||||
echo "::${AZURACAST_SPACES} Updating script"
|
|
||||||
./docker.sh update-self
|
|
||||||
echo "::${AZURACAST_SPACES} Updating AzuraCast"
|
|
||||||
./docker.sh update
|
|
||||||
echo "::${AZURACAST_SPACES} Reapplying docker-compose.yml"
|
|
||||||
cp /var/azuracast/docker-compose.recommended.yml /var/azuracast/docker-compose.yml
|
|
||||||
env AZURACAST_ARROWS="${AZURACAST_SPACES} " $0 restart
|
|
||||||
echo "::${AZURACAST_SPACES} Updated AzuraCast"
|
|
||||||
exit 0
|
|
||||||
elif [ "$1" == "cli" ]; then
|
|
||||||
echo "::${AZURACAST_SPACES} Entering AzuraCast CLI"
|
|
||||||
echo "::${AZURACAST_SPACES} Execute cli:help for help."
|
|
||||||
while true; do
|
|
||||||
echo -n "AZURACAST$ "
|
|
||||||
read -r AZURACAST_CLI
|
|
||||||
if [ "$AZURACAST_CLI" == "cli:help" ]; then
|
|
||||||
echo "help | Help command"
|
|
||||||
echo "exit | Exit CLI"
|
|
||||||
elif [ "$AZURACAST_CLI" == "cli:exit" ]; then
|
|
||||||
break
|
|
||||||
elif [ "$AZURACAST_CLI" == "cli" ] || [ "$AZURACAST_CLI" == "cli:" ]; then
|
|
||||||
echo "Use cli:help for help."
|
|
||||||
else
|
|
||||||
./docker.sh cli $AZURACAST_CLI
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
exit $?
|
|
||||||
elif [ "$1" == "shell" ]; then
|
|
||||||
echo "::${AZURACAST_SPACES} Entering AzuraCast shell"
|
|
||||||
./docker.sh bash
|
|
||||||
exit $?
|
|
||||||
else
|
|
||||||
echo "::${AZURACAST_SPACES} ERROR: Invalid subcommand."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
|
@ -1,38 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
if [ "$1" == "on" ]; then
|
|
||||||
if [ ! "$SOSCMD_STARTUP_SILENCE" == "true" ]; then echo ":: Enabling startup mode";fi
|
|
||||||
systemctl stop httpd
|
|
||||||
if [ ! -d "/etc/httpd/conf/sites-enabled-startup" ]; then
|
|
||||||
echo ":: Error: Already in startup mode."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
mv "/etc/httpd/conf/sites-enabled" "/etc/httpd/conf/sites-enabled-runtime"
|
|
||||||
mv "/etc/httpd/conf/sites-enabled-startup" "/etc/httpd/conf/sites-enabled"
|
|
||||||
if [ "$SOSCMD_STARTUP_WEBSERVER" == "true" ]; then
|
|
||||||
systemctl start httpd
|
|
||||||
fi
|
|
||||||
exit 0
|
|
||||||
elif [ "$1" == "off" ]; then
|
|
||||||
if [ ! "$SOSCMD_STARTUP_SILENCE" == "true" ]; then echo ":: Disabling startup mode";fi
|
|
||||||
systemctl stop httpd
|
|
||||||
if [ -d "/etc/httpd/conf/sites-enabled-startup" ]; then
|
|
||||||
echo ":: Error: Already in runtime mode."
|
|
||||||
exit 2
|
|
||||||
fi
|
|
||||||
mv "/etc/httpd/conf/sites-enabled" "/etc/httpd/conf/sites-enabled-startup"
|
|
||||||
mv "/etc/httpd/conf/sites-enabled-runtime" "/etc/httpd/conf/sites-enabled"
|
|
||||||
if [ "$SOSCMD_STARTUP_WEBSERVER" == "true" ]; then
|
|
||||||
systemctl start httpd
|
|
||||||
fi
|
|
||||||
exit 0
|
|
||||||
else
|
|
||||||
echo ":: Error: Invalid argument. Use 'on' or 'off' to manage startup mode."
|
|
||||||
if [ "$SOSCMD_STARTUP_WEBSERVER" == "true" ]; then
|
|
||||||
echo ":: Oh, and it seems like \"SOSCMD_STARTUP_WEBSERVER\" is set."
|
|
||||||
echo ":: The webserver will start automatically if set to true."
|
|
||||||
else
|
|
||||||
echo ":: For starting apache2 automatically, set \"SOSCMD_STARTUP_WEBSERVER\""
|
|
||||||
echo ":: to true. You must start it manually if not set to true."
|
|
||||||
fi
|
|
||||||
exit 99
|
|
||||||
fi
|
|
Loading…
Reference in a new issue