Added auto download the newer version of teamspeak3

This commit is contained in:
Marcin Woźniak 2020-03-05 22:32:37 +01:00 committed by Marcin Wozniak
parent 69e5005586
commit 2d7fe5b512
3 changed files with 63 additions and 3 deletions

BIN
.update.swp Normal file

Binary file not shown.

5
update
View File

@ -1,12 +1,11 @@
#!/bin/bash
LINK="http://files.teamspeak-services.com/releases/server/3.6.0/teamspeak3-server_linux_amd64-3.6.0.tar.bz2"
VERSION=$(curl http://files.teamspeak-services.com/releases/server/ | egrep -o '[0-9]+\.[0-9]+\.[0-9]+' | sort | uniq | sort --version-sort --field-separator=. | tail -n1)
LINK="http://files.teamspeak-services.com/releases/server/$VERSION/teamspeak3-server_linux_amd64-$VERSION.tar.bz2"
service_ts3="ts3server serveradmin"
ts3local="/opt/teamspeak/"
mkdir -p $ts3local
if (( $(ps -ef | grep -v grep | grep "$service_ts3" | wc -l) > 0))
then

61
updatenew Executable file
View File

@ -0,0 +1,61 @@
#!/bin/bash
set -x
LINK="https://files.teamspeak-services.com/releases/server/3.11.0/teamspeak3-server_linux_amd64-3.11.0.tar.bz2"
service_ts3="ts3server serveradmin"
ts3local="/opt/teamspeak/"
mkdir -p $ts3local
if (( $(ps -ef | grep -v grep | grep "$service_ts3" | wc -l) > 0))
then
alive_ts3=1
else
alive_ts3=0
fi
if (alive_ts3=1)
then
systemctl stop teamspeak
fi
if (alive_ts3=0)
then
#Tworzenie BACKUPU
sudo mkdir -p /BACKUP/
cp -rp /opt/ /BACKUP/opt-$(date +"%d-%m-%Y")/
#POBIERANIE NAJNOWSZEJ WERSJI TS3
wget $LINK --quiet
#ROZPAKOWANIE TS3 & SKOPIOWANIE PLIKOW
tar -jxf teamspeak3-server_linux_amd*.tar.bz2
cp -rp /opt/teamspeak3-server_linux_amd64/CHANGELOG $ts3local
cp -rp /opt/teamspeak3-server_linux_amd64/doc $ts3local
cp -rp /opt/teamspeak3-server_linux_amd64/ts3server $ts3local
cp -rp /opt/teamspeak3-server_linux_amd64/ts3server_minimal_runscript.sh $ts3local
cp -rp /opt/teamspeak3-server_linux_amd64/ts3server_startscript.sh $ts3local
cp -rp /opt/teamspeak3-server_linux_amd64/sql $ts3local
cp -rp /opt/teamspeak3-server_linux_amd64/redist $ts3local
cp -rp /opt/teamspeak3-server_linux_amd64/serverquerydocs $ts3local
cp -rp /opt/teamspeak3-server_linux_amd64/libts3_ssh.so $ts3local
#USUNIECIE BZDET
rm -rf teamspeak3-server_linux_amd*.tar.bz2 teamspeak3-server_linux_amd64*
#START TEAMSPEAK
systemctl start teamspeak
if (( $(ps -ef | grep -v grep | grep "$service_ts3" | wc -l) > 0))
then
echo -e "\e[32m$service_ts3 is running!!!\e[0m"
else
echo -e "\e[31m$service_ts3 is not running!!!\e[0m"
sleep 5
systemctl start teamspeak
fi
fi