version check in curl installation

This commit is contained in:
Filip Bartodziej 2017-12-08 17:39:31 +01:00 committed by Nick Craig-Wood
parent b48b537325
commit ab03f6e475

View file

@ -9,9 +9,23 @@ if [ -n "$1" ] && [ "$1" != "beta" ]; then
fi fi
if [ -n "$1" ]; then if [ -n "$1" ]; then
install_beta="yes" install_beta="beta "
fi fi
#check installed version of rclone to determine if update is necessary
version=`rclone --version | head -n 1`
if [ -z "${install_beta}" ]; then
current_version=`curl https://downloads.rclone.org/version.txt`
else
current_version=`curl https://beta.rclone.org/version.txt`
fi
if [ "$version" = "$current_version" ]; then
echo && echo "The latest ${install_beta}version of rclone is already installed" && echo
exit 1
fi
#detect the platform #detect the platform
OS="`uname`" OS="`uname`"
case $OS in case $OS in