2021-11-07 12:13:59 +00:00
#!/bin/bash
2021-11-07 12:19:18 +00:00
RCLONE_PATH = "./.rclone-files/"
2021-11-07 12:13:59 +00:00
ARCH = $( uname -m)
2021-11-07 12:19:18 +00:00
RCLONE_URL = ""
FUSERMOUNT_URL = ""
2021-11-07 12:13:59 +00:00
if [ " $ARCH " = = "armv7l" ] ; then
2021-11-07 12:24:31 +00:00
RCLONE_URL = "https://beta.rclone.org/test/testbuilds-latest/rclone-android-16-armv7a.gz"
FUSERMOUNT_URL = "https://github.com/Magisk-Modules-Repo/com.piyushgarg.rclone/raw/master/binary/fusermount-arm"
2021-11-07 12:13:59 +00:00
elif [ " $ARCH " = = "aarch64" ] ; then
2021-11-07 12:24:31 +00:00
RCLONE_URL = "https://beta.rclone.org/test/testbuilds-latest/rclone-android-21-armv8a.gz"
FUSERMOUNT_URL = "https://github.com/Magisk-Modules-Repo/com.piyushgarg.rclone/raw/master/binary/fusermount-arm64"
2021-11-07 12:13:59 +00:00
else
echo " Unsupported architecture: $ARCH "
exit 1
fi
2021-11-07 12:24:31 +00:00
echo "!!! YOU NEED ROOT TO RUN THIS SCRIPT !!!"
2021-11-07 15:24:17 +00:00
echo "This script was made before I discovered that Termux Rclone can work perfectly too if you mount to /mnt/runtime/write/emulated/0/, using this script may lead to unwanted change in your phone."
read -p "Do you want to continue (Y/n)? " -n 1 -r
echo # (optional) move to a new line
if [ [ ! $REPLY = ~ ^[ Yy] $ ] ]
then
[ [ " $0 " = " $BASH_SOURCE " ] ] && exit 1 || return 1 # handle exits from shell or function but don't exit interactive shell
fi
2021-11-07 12:24:31 +00:00
echo "Installing dependencies..."
pkg install root-repo tsu wget
echo "Setting up Termux shared storage..."
termux-setup-storage
echo "Downloading rclone..."
mkdir -p $RCLONE_PATH
2021-11-07 12:13:59 +00:00
wget -O - $RCLONE_URL | gunzip -c > " $RCLONE_PATH /rclone "
echo "Downloading fusermount..."
wget -O " $RCLONE_PATH /fusermount " $FUSERMOUNT_URL
sudo chmod -R 0755 ./.rclone-files/
echo "Setup completed, you MUST execute ./rclone-shell before using rclone."