Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Massively simplify rclone installation #174

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
57 changes: 19 additions & 38 deletions packages/package/install/installpackage-rclone
Original file line number Diff line number Diff line change
Expand Up @@ -17,45 +17,23 @@
# including (via compiler) GPL-licensed code must also be made available
# under the GPL along with build & install instructions.

local_setup=/etc/QuickBox/setup/
OUTTO=/srv/rutorrent/home/db/output.log
MASTER=$(cat /srv/rutorrent/home/db/master.txt)
arch=$(arch)
if [[ -f /tmp/.install.lock ]]; then
OUTTO="/root/logs/install.log"
elif [[ -f /install/.panel.lock ]]; then
OUTTO="/srv/panel/db/output.log"
else
OUTTO="/dev/null"
fi
MASTER=$(cat /root/.master.info | cut -d: -f1)

echo "Downloading rclone ... " >>"${OUTTO}" 2>&1;
echo "Downloading and installing rclone ..." >>"${OUTTO}" 2>&1;

if [[ $arch == x86_64 ]]; then
cd /tmp
curl -O https://downloads.rclone.org/rclone-current-linux-amd64.zip
unzip rclone-*
cd rclone-*-linux-amd64
cp rclone /usr/sbin/
chown root:root /usr/sbin/rclone
chmod 755 /usr/sbin/rclone
ln -s /usr/sbin/rclone /usr/bin/rclone
sudo mkdir -p /usr/local/share/man/man1
sudo cp rclone.1 /usr/local/share/man/man1/
sudo mandb
cd /tmp
rm -rf rclone-*
fi
if [[ $arch == i386 ]]; then
cd /tmp
curl -O https://downloads.rclone.org/rclone-current-linux-386.zip
unzip rclone-*
cd rclone-*-linux-386
cp rclone /usr/sbin/
chown root:root /usr/sbin/rclone
chmod 755 /usr/sbin/rclone
ln -s /usr/sbin/rclone /usr/bin/rclone
sudo mkdir -p /usr/local/share/man/man1
sudo cp rclone.1 /usr/local/share/man/man1/
sudo mandb
cd /tmp
rm -rf rclone-*
fi
# One-liner to check arch/os type, as well as download latest rclone for relevant system.
curl https://rclone.org/install.sh | sudo bash

echo "Installing rclone ... " >>"${OUTTO}" 2>&1;
# Make sure rclone downloads and installs without error before proceeding
if [ $? -eq 0 ]; then
echo "Adding rclone mount service..." >>"${OUTTO}" 2>&1;

cat >/etc/systemd/system/rclone@.service<<EOF
[Unit]
Expand All @@ -78,8 +56,11 @@ WantedBy=multi-user.target

EOF

touch /install/.rclone.lock
echo "rclone installation complete!" >>"${OUTTO}" 2>&1;
touch /install/.rclone.lock
echo "rclone installation complete!" >>"${OUTTO}" 2>&1;
else
echo "Issue occured during rclone installation." >>"${OUTTO}" 2>&1;
fi
echo >>"${OUTTO}" 2>&1;
echo >>"${OUTTO}" 2>&1;
echo "Close this dialog box to refresh your browser" >>"${OUTTO}" 2>&1;