Make version semantic (Closes #49)

What's still missing from this is a version comparison mechanism.  The
reason why it is missing is that we only use this in one place at the
moment, and if you have a version string that is not three digits, your
version is recent enough.  This means we can save this for when there
are a common functions script to import and make the comparisons for us
without code duplication.
This commit is contained in:
T. Joseph Carter
2016-10-27 02:13:58 -07:00
parent 530b8d57f5
commit ee4078ab23
3 changed files with 20 additions and 8 deletions
+7 -3
View File
@@ -56,9 +56,10 @@ if [[ $debianVersion ]]; then
fi
# skip this if already done
if [[ -f /usr/local/etc/A2SERVER-version && $(head -c 3 /usr/local/etc/A2SERVER-version) -ge 101 ]]; then
echo "A2SERVER: Netatalk is already installed."
else
if [[ -f /usr/local/etc/A2SERVER-version ]]; then
read a2sVersion </usr/local/etc/A2SERVER-version
fi
if [[ $a2sVersion = *.*.* || $a2sVersion -ge 101]]; then
echo "A2SERVER: Installing Netatalk (this will take a while)..."
# stop Netatalk and samba if running (during upgrade)
if [[ $(ps --no-headers -C afpd) ]]; then
@@ -176,7 +177,10 @@ else
cd
rm -rf /tmp/netatalk
fi
else
echo "A2SERVER: Netatalk is already installed."
fi
unset a2sVersion
# --- Install MacIPgw
if ! hash macipgw &>/dev/null; then