• Be part of the TeaParty!
    Click here for more information

Information TeaSpeak update script (Include Auto)

Leutech

Active member
Premium User
WARNING!!! This script needs these installed packages "zip", "unzip" und "curl"! To work correctly!

The script mustn't run as root!


Greetings dear TeaSpeak community.

I have created an TeaSpeak Server update script with repository choise and automatic update system.

I'll explain briefly how it works.

1. You can start this script with several subcommands such like "u", "fn", "fs", "fo" or "fd"
  • u = Update with user interaction, repository choise and Informations
  • fn = Update without user interaction and informations. He use the normal repository such like "amd64" or "x86"
  • fs = Same as "fn" but with the "stable" channel such like "amd64_stable" or "x86_stable"
  • fo = Same as "fn" but with the "optimized" channel
  • fd = Same as "fn" but with the "debug" channel
2. After you have choose an option he will scan your os if the os is x64 or x32
3. If you have choose option "u" you can choose if you want the messages in english or german and than you can choose from which channel the script should get the update
4. Check if the teaspeak server is on the same directory with this script
5. check the version and going on if the installed version is deprecated
6. checking if the ts server is running and stop it if neccessary
7. make an backup in .zip type and check if the backup successfully created
8. download the update, extract it, delete the archive
9. checking if the update successfull
10. restart the teaspeak server and check if the ts is running

The script creates automatically a log file. If something going wrong the script write in this log file whats going wrong.

ACHTUNG!!! Das Skript benötigt installierte Pakete wie "zip", "unzip" und "curl"! Um ordentlich zu funtkionieren!

Das Skript darf nicht als root ausgeführt werden!


Grüße an die TeaSpeak Community.

Ich habe ein TeaSpeak Server Update Skript erstellt, mit Quellenauswahl und mit automatischen update System.

Ich erkläre kurz wie es funktioniert.

1. Du kannst das Skript mit verschiedenen Unterbefehlen starten, wie z.B.: "u", "fn", "fs", "fo" oder "fd"
  • u = Updatet mit Nutzer Interaktionen, Quellenauswahl und Informationen
  • fn = Updatet ohne Nutzer Interaktionen und Quellenauswahl. Er nutzt die normale Quelle wie "amd64" oder "x86"
  • fs = Das selbe wie bei "fn" aber mit der "stable" Quelle, wie "amd64_stable" or "x86_stable"
  • fo = Das selbe wie bei "fn" aber mit der "optimized" Quelle
  • fd = Das selbe wie bei "fn" aber mit der "debug" Quelle
2. Nach dem du dich für eine Option entschieden hast, scannt das Skript dein Betriebssystem, ob es auf 64x oder 32x bit läuft.
3. Wenn du option "u" ausgewählt hast, kannst du auswählen, ob du die Nachrichten auf Englsich oder Deutsch haben möchtest und dann kannst du auswählen aus welcher Quelle er das Update beziehen soll.
4. Überprüft ob der TeaSpeak Server im selben Ordner ist, wie das Skript
5. Überpürft die Version und fährt fort wenn deine Version veraltet ist.
6. Überpürft, ob der TeaSpeak Server online ist und stoppt ihn, falls er Online ist.
7. Erstelle ein Backup im .zip Format und überprüft, ob das Backup erstellt wurde.
8. Downloadet das Update, entpackt es, entfernt das Archiv
9. Überprüft, ob das Update erfolgreich ist
10. Startet den TeaSpeak Server wieder und überpürft auch natürlich ob er erfolgreich gestartet wurde.

Das Skript erstellt automatisch eine Log Datei. Wenn irgendwas nicht hin haut oder sonstiges, schreibt das Skript es in die Log Datei.

Wenn es Verbesserungsvorschläge gibt, dann zögert nicht und schreibt es hier hin oder mir per PN.

Script startup.png

Update successfull.png


PS. I hope your like it ^^ | Ich hoffe es gefällt euch ^^
 

Attachments

Last edited by a moderator:

WolverinDEV

TeaSpeak Team
Staff member
Administrator
Seems to be a good script :)
Haven't yet tested it out but the first glance was promising.

Vil noch etwas am Format des threads herumspielen :)
 

otalportista

Fanatic member
Premium User
Suggestion:
Make a option to select language.
And you have "./TS-Update.sh" if user changes name the command its not correct put it on bash script and it get name of file.
Code:
me="$(basename "$(test -L "$0" && readlink "$0" || echo "$0")")"
echo $me
 

WolverinDEV

TeaSpeak Team
Staff member
Administrator
Okey
I just reviewed the code on ths PC now and to be honest it looks quite good and clean.
But one thing I've noticed is that you're having a lot of sleeps in there, manly (I guess) for animation reasons.
Specially in a automated system this could annoy. So I recommand an option to disabled these sleeps.
Example would be:
Code:
do_sleep=0
[[ ${do_sleep} -eq 1 ]] && sleep 1
Edit:
I was so free to hide the German version within a spoiler.
This looks much cleaner and more readable. As well the bigger part of this forum isn't German :)
 

Leutech

Active member
Premium User
@WolverinDEV thank you for your good feedback for my script it takes me a lot of sh*t time to compare the fucking version check :( but i have made it ^^ if anyone have suggestions please send it to me and i think about the suggestion if is it possible and if is a good idea to bring it into the script
And @otalportista why i should get name from the script? The script doesn't handle with itself. Or i don't know what you mean.
 

otalportista

Fanatic member
Premium User
I tested it now and when i change name of default file ( TS-Update.sh ) i changed on script, when i say it before i didn't test it, sorry.
About select language, I think it is good to add a system of choices, ie remove the commands "u", "fn", etc, and put a menu system, the first would be the language selection, after the user chose, that would go to a default menu according to the language chosen, with the options update, force-update etc. I think I'm explaining well, if not this.
 

Leutech

Active member
Premium User
If i use a seperate menu with first language choice and than then the option to force and etc. it will be not possible to do the auto update
 

Leutech

Active member
Premium User
So now i can write better ^^. I mean the options "fn" "fo" "fs" and "fd" are therfore to use this script with crontab. So that you dont need to execute this script. Because with crontab you have the choise when the script should be executed, such like every day at 6 am or every 8h or any time you want. For this are the options "fn" "fs" "fo" and "fd"
 

otalportista

Fanatic member
Premium User
So now i can write better ^^. I mean the options "fn" "fo" "fs" and "fd" are therfore to use this script with crontab. So that you dont need to execute this script. Because with crontab you have the choise when the script should be executed, such like every day at 6 am or every 8h or any time you want. For this are the options "fn" "fs" "fo" and "fd"
For example if user want auto update ( if you have with option), for example option 6 are auto update, user put directory of teaspeak installation, next user put how much time for do it and it put on crontab it