version check in curl installation
This commit is contained in:
parent
b48b537325
commit
ab03f6e475
1 changed files with 15 additions and 1 deletions
|
@ -9,9 +9,23 @@ if [ -n "$1" ] && [ "$1" != "beta" ]; then
|
|||
fi
|
||||
|
||||
if [ -n "$1" ]; then
|
||||
install_beta="yes"
|
||||
install_beta="beta "
|
||||
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
|
||||
OS="`uname`"
|
||||
case $OS in
|
||||
|
|
Loading…
Reference in a new issue