-
Notifications
You must be signed in to change notification settings - Fork 168
Expand file tree
/
Copy pathinstallpackage-rclone
More file actions
66 lines (57 loc) · 1.96 KB
/
installpackage-rclone
File metadata and controls
66 lines (57 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/bin/bash
#
# [Quick Box :: Install rclone]
#
# GITHUB REPOS
# GitHub _ packages : https://github.com/QuickBox/quickbox_packages
# LOCAL REPOS
# Local _ packages : /etc/QuickBox/packages
# Author : DedSec | d2dyno
# URL : https://quickbox.io
#
# QuickBox Copyright (C) 2017 QuickBox.io
# Licensed under GNU General Public License v3.0 GPL-3 (in short)
#
# You may copy, distribute and modify the software as long as you track
# changes/dates in source files. Any modifications to our software
# including (via compiler) GPL-licensed code must also be made available
# under the GPL along with build & install instructions.
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 and installing rclone ..." >>"${OUTTO}" 2>&1;
# One-liner to check arch/os type, as well as download latest rclone for relevant system.
curl https://rclone.org/install.sh | sudo bash
# 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]
Description=rclonemount
After=network.target
[Service]
Type=simple
User=%I
Group=%I
ExecStart=/usr/sbin/rclone mount /home/%I/cloud --allow-non-empty --allow-other --dir-cache-time 10m --max-read-ahead 9G --checkers 32 --contimeout 15s --quiet
ExecStop=/bin/fusermount -u /home/%I/cloud
Restart=on-failure
RestartSec=30
StartLimitInterval=60s
StartLimitBurst=3
[Install]
WantedBy=multi-user.target
EOF
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;