1
0
mirror of https://bitbucket.org/shim_/docker-teamspeak.git synced 2018-10-04 01:51:57 +02:00

basic upgrade mechanism

This commit is contained in:
shim_ 2016-08-09 18:19:46 +02:00
parent e915ebe274
commit 205fccf316

36
init.sh
View File

@ -45,12 +45,7 @@ function db_config {
fi
}
SERVER_DIR=/opt/teamspeak3
RUNSCRIPT=$SERVER_DIR/ts3server_minimal_runscript.sh
CONF_DIR=$SERVER_DIR
if [ ! -f "$RUNSCRIPT" ] || [ ! -z "$UPGRADE" ]; then
echo Starting Initialization
function upgrade_ts3 {
URL=http://dl.4players.de/ts/releases/$TS_VERSION/teamspeak3-server_linux_$ARCH-$TS_VERSION.tar.bz2
TMPFILE=/tmp/server.tar.bz2
wget $URL -O $TMPFILE
@ -67,14 +62,25 @@ if [ ! -f "$RUNSCRIPT" ] || [ ! -z "$UPGRADE" ]; then
mv -u /opt/teamspeak3-server_linux_$ARCH/* /opt/teamspeak3/
rm -rf /opt/teamspeak3-server_linux_$ARCH
rm -f $TMPFILE
main_config
db_config
echo "$ARCH-$TS_VERSION" -n > /opt/teamspeak3/INSTALLED_VERSION
}
SERVER_DIR=/opt/teamspeak3
RUNSCRIPT=$SERVER_DIR/ts3server_minimal_runscript.sh
CONF_DIR=$SERVER_DIR
if [ ! -f "$RUNSCRIPT" ] || [ ! -z "$UPGRADE" ]; then
echo Starting Initialization
if [[ ! -f "/opt/teamspeak3/INSTALLED_VERSION" || ( "$(cat /opt/teamspeak3/INSTALLED_VERSION)" != "$ARCH-$TS_VERSION" && ! -z "$UPGRADE") ]]; then
if [ ! -f "$RUNSCRIPT" ]; then
upgrade_ts3
main_config
db_config
else
upgrade_ts3
fi
fi
fi
if [ -z "$UPGRADE" ]; then
wait_for_mysql
$RUNSCRIPT inifile=$CONF_DIR/ts3server.ini
else
echo "Upgrade complete"
exit 0
fi
wait_for_mysql
$RUNSCRIPT inifile=$CONF_DIR/ts3server.ini