I'm trying to put a "function" inside of a script to install the latest version of "TeamSpeak3" Client and make all configurations.
My problem is I don't know how to make a function to test the version number part, "number.number.number.number". The numbers range from 0 to 99.
For example, I'm given a variable that has the value within a URL:
URL=http://dl.4players.de/ts/releases/$version/TeamSpeak3-Client-linux_$arch-$version.run
Here the variable, $Version, the latest is 3.0.16. The current latest URL is:
http://dl.4players.de/ts/releases/3.0.16/TeamSpeak3-Client-linux_x86-3.0.16.run
But in the future when I use the script, I want it to determine automatically the latest version, checking the numbers within the URL.
For "archs" I have this code:
# Determining the system arch
arch=$(uname -m)
case "$arch" in
x86) arch="x86" ;;
i?86) arch="x86" ;;
amd64) arch="amd64" ;;
x86_64) arch="x86_64" ;;
* ) echo "Your Arch '$arch' -> Its not supported." ;;
esac
Maybe an array or something like that? Can someone help me with this idea?