"rsync for cloud storage" - Google Drive, S3, Dropbox, Backblaze B2, One Drive, Swift, Hubic, Wasabi, Google Cloud Storage, Azure Blob, Azure Files, Yandex Files
Go azure-blobazure-blob-storageazure-filesbackblaze-b2cloud-storagedropboxencryptionftpfuse-filesystemgogolanggoogle-cloud-storagegoogle-driveonedriveopenstack-swiftrclones3sftpsyncwebdav
install.sh: fix some shellcheck warnings
Ivan Andreev088a83872d34
diff --git a/docs/content/install.sh b/docs/content/install.shindex 7804627bc..33f7f5c53 100755--- a/docs/content/install.sh+++ b/docs/content/install.sh@@ -25,13 +25,14 @@ fi#create tmp directory and move to it with macOS compatibility fallback-tmp_dir=`mktemp -d 2>/dev/null || mktemp -d -t 'rclone-install.XXXXXXXXXX'`; cd $tmp_dir+tmp_dir=$(mktemp -d 2>/dev/null || mktemp -d -t 'rclone-install.XXXXXXXXXX')+cd "$tmp_dir"#make sure unzip tool is available and choose one to work withset +efor tool in ${unzip_tools_list[*]}; do- trash=`hash $tool 2>>errors`+ trash=$(hash "$tool" 2>>errors)if [ "$?" -eq 0 ]; thenunzip_tool="$tool"break@@ -40,7 +41,7 @@ doneset -e# exit if no unzip tools available-if [ -z "${unzip_tool}" ]; then+if [ -z "$unzip_tool" ]; thenprintf "\nNone of the supported tools for extracting zip archives (${unzip_tools_list[*]}) were found. "printf "Please install one of them and try again.\n\n"exit 4@@ -50,11 +51,11 @@ fiexport XDG_CONFIG_HOME=config#check installed version of rclone to determine if update is necessary-version=`rclone --version 2>>errors | head -n 1`-if [ -z "${install_beta}" ]; then- current_version=`curl https://downloads.rclone.org/version.txt`+version=$(rclone --version 2>>errors | 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`+ current_version=$(curl https://beta.rclone.org/version.txt)fiif [ "$version" = "$current_version" ]; then@@ -63,9 +64,8 @@ if [ "$version" = "$current_version" ]; thenfi-#detect the platform-OS="`uname`"+OS="$(uname)"case $OS inLinux)OS='linux'@@ -93,8 +93,8 @@ case $OS in;;esac-OS_type="`uname -m`"-case $OS_type in+OS_type="$(uname -m)"+case "$OS_type" inx86_64|amd64)OS_type='amd64';;@@ -115,43 +115,42 @@ esac#download and unzip-if [ -z "${install_beta}" ]; then- download_link="https://downloads.rclone.org/rclone-current-$OS-$OS_type.zip"- rclone_zip="rclone-current-$OS-$OS_type.zip"+if [ -z "$install_beta" ]; then+ download_link="https://downloads.rclone.org/rclone-current-${OS}-${OS_type}.zip"+ rclone_zip="rclone-current-${OS}-${OS_type}.zip"else- download_link="https://beta.rclone.org/rclone-beta-latest-$OS-$OS_type.zip"- rclone_zip="rclone-beta-latest-$OS-$OS_type.zip"+ download_link="https://beta.rclone.org/rclone-beta-latest-${OS}-${OS_type}.zip"+ rclone_zip="rclone-beta-latest-${OS}-${OS_type}.zip"fi-curl -O $download_link+curl -O "$download_link"unzip_dir="tmp_unzip_dir_for_rclone"# there should be an entry in this switch for each element of unzip_tools_list-case $unzip_tool in+case "$unzip_tool" in'unzip')- unzip -a $rclone_zip -d $unzip_dir+ unzip -a "$rclone_zip" -d "$unzip_dir";;'7z')- 7z x $rclone_zip -o$unzip_dir+ 7z x "$rclone_zip" "-o$unzip_dir";;'busybox')- mkdir -p $unzip_dir- busybox unzip $rclone_zip -d $unzip_dir+ mkdir -p "$unzip_dir"+ busybox unzip "$rclone_zip" -d "$unzip_dir";;esac--cd $unzip_dir/*+cd $unzip_dir/*#mounting rclone to environment-case $OS in+case "$OS" in'linux')#binarycp rclone /usr/bin/rclone.newchmod 755 /usr/bin/rclone.newchown root:root /usr/bin/rclone.newmv /usr/bin/rclone.new /usr/bin/rclone- #manuals+ #manualif ! [ -x "$(command -v mandb)" ]; thenecho 'mandb not found. The rclone man docs will not be installed.'else@@ -161,11 +160,11 @@ case $OS infi;;'freebsd'|'openbsd'|'netbsd')- #bin+ #binarycp rclone /usr/bin/rclone.newchown root:wheel /usr/bin/rclone.newmv /usr/bin/rclone.new /usr/bin/rclone- #man+ #manualmkdir -p /usr/local/man/man1cp rclone.1 /usr/local/man/man1/makewhatis@@ -186,7 +185,7 @@ esac#update version variable post install-version=`rclone --version 2>>errors | head -n 1`+version=$(rclone --version 2>>errors | head -n 1)printf "\n${version} has successfully installed."printf '\nNow run "rclone config" for setup. Check https://rclone.org/docs/ for more details.\n\n'