shell-host/modules/install/tools/rclone-install.func

30 lines
974 B
Plaintext

sudo rclone.bin
chmod 775 rclone.bin
touch $INSTALL_DIR/rclone
touch $INSTALL_DIR/rclone.conf
mkdir $INSTALL_DIR/cache 2> /dev/null || true
echo '#!/bin/bash' > $INSTALL_DIR/rclone
CMD=$(echo $INSTALL_DIR/rclone.bin \
--config=$INSTALL_DIR/rclone.conf \
--cache-dir=$INSTALL_DIR/cache \
'$@' \
)
echo "$CMD" >> $INSTALL_DIR/rclone
chown :sudo rclone
chmod 775 rclone
rm $BIN_DIR/rclone
ln -s $INSTALL_DIR/rclone $BIN_DIR/rclone
echo -e "rclone customized command can be launched from $(command -v rclone) \n $CMD"
echo -e "uncustomized rclone can be run from $INSTALL_DIR/rclone.bin"
cd ..
#update version variable post install
version=`rclone --version 2>>errors | head -n 1`
printf "\n${last_version} has successfully installed."
printf '\nNow run "rclone config" to set up remotes. Check https://rclone.org/docs/ for more details.\n\n'
return 0
}