I have to update a script compilation from time to time but I haven't any idea how to start a version check script in bash.
I've got a version file with 3 vars:
subsubversion=1 and I've got a web server that serves the updates with install routines as bash scripts. In a directory called updates:
/updates/ 0.0.1 0.0.2 0.0.3
and a directory called current where the current version is stored.
/current/ 0.0.1 version
Now I'd like to have a script that takes
$subsubversion and determines witch update to download and execute. After this part has finished the update script should increment a var so that it downloads the next update if it is available. Let's call it
I stuck with incrementing the three vars and the
nextversion variable in the update script.
What could I do to increment the tree vars and a fourth var to the next higher level. How do I handle it if I go from 0.0.9 to 0.1.0 or even from 0.9.9 to 1.0.0 and so on. Without producing a lot of
elif statements. I'm sadly not good in figuring out loops.