2014-04-15 12:04:04 +00:00
|
|
|
#!/bin/bash
|
2018-01-07 00:46:21 +00:00
|
|
|
set -euo pipefail
|
|
|
|
|
2014-04-15 12:27:20 +00:00
|
|
|
VOLUME=/teamspeak3
|
2014-04-15 12:04:04 +00:00
|
|
|
|
2018-02-14 21:29:54 +00:00
|
|
|
if [ -e "${VOLUME}/.ts3server_license_accepted" ]; then
|
2018-03-25 12:02:54 +00:00
|
|
|
echo "- Accepting license as you requested"
|
|
|
|
touch /opt/teamspeak3-server_linux_amd64/.ts3server_license_accepted
|
2018-02-14 21:29:54 +00:00
|
|
|
fi
|
|
|
|
|
2018-01-07 00:46:21 +00:00
|
|
|
echo "- Linking host mounted database..."
|
|
|
|
|
2018-03-25 12:01:44 +00:00
|
|
|
if ! [ -L /opt/teamspeak3-server_linux_amd64/ts3server.sqlitedb ]; then
|
2018-03-25 12:02:54 +00:00
|
|
|
ln -s $VOLUME/ts3server.sqlitedb /opt/teamspeak3-server_linux_amd64/ts3server.sqlitedb
|
2018-03-25 12:01:44 +00:00
|
|
|
fi
|
2018-01-07 00:46:21 +00:00
|
|
|
|
|
|
|
echo "- Link the files-folder into the host-mounted volume..."
|
2015-01-30 11:44:21 +00:00
|
|
|
|
2018-01-07 00:46:21 +00:00
|
|
|
mkdir -p ${VOLUME}/files
|
2016-03-10 03:59:17 +00:00
|
|
|
if ! [ -L /opt/teamspeak3-server_linux_amd64/files ]; then
|
2018-03-25 12:02:54 +00:00
|
|
|
rm -rf /opt/teamspeak3-server_linux_amd64/files
|
|
|
|
ln -s ${VOLUME}/files /opt/teamspeak3-server_linux_amd64/files
|
2015-01-30 11:44:21 +00:00
|
|
|
fi
|
2014-04-15 12:04:04 +00:00
|
|
|
|
2018-01-07 00:46:21 +00:00
|
|
|
echo "- Starting TS3-Server..."
|
|
|
|
if [ -f "${VOLUME}/ts3server.ini" ]; then
|
2018-03-25 12:02:54 +00:00
|
|
|
echo " '${VOLUME}/ts3server.ini' found. Using as config file."
|
|
|
|
echo " HINT: If this ini was transfered from another ts3-install you may want"
|
|
|
|
echo " to make sure the following settings are active for the usage of host-mounted volume:"
|
|
|
|
echo " - query_ip_whitelist='${VOLUME}/query_ip_whitelist.txt'"
|
|
|
|
echo " - query_ip_backlist='${VOLUME}/query_ip_blacklist.txt'"
|
|
|
|
echo " - logpath='${VOLUME}/logs/'"
|
|
|
|
echo " - licensepath='${VOLUME}/'"
|
|
|
|
echo " - inifile='${VOLUME}/ts3server.ini'"
|
|
|
|
/opt/teamspeak3-server_linux_amd64/ts3server_minimal_runscript.sh \
|
|
|
|
inifile="${VOLUME}/ts3server.ini"
|
2015-01-16 18:54:47 +00:00
|
|
|
else
|
2018-03-25 12:02:54 +00:00
|
|
|
echo " '${VOLUME}/ts3server.ini' not found. Creating new config file."
|
|
|
|
/opt/teamspeak3-server_linux_amd64/ts3server_minimal_runscript.sh \
|
|
|
|
createinifile=1 \
|
|
|
|
inifile="${VOLUME}/ts3server.ini" \
|
|
|
|
licensepath="${VOLUME}/" \
|
|
|
|
logpath="${VOLUME}/logs/" \
|
|
|
|
query_ip_backlist="${VOLUME}/query_ip_blacklist.txt" \
|
|
|
|
query_ip_whitelist="${VOLUME}/query_ip_whitelist.txt"
|
2014-04-16 09:39:55 +00:00
|
|
|
fi
|