This repository was archived by the owner on Jun 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·74 lines (60 loc) · 2.01 KB
/
install.sh
File metadata and controls
executable file
·74 lines (60 loc) · 2.01 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
67
68
69
70
71
72
73
74
#!/bin/bash
#########################################
## ENVIRONMENTAL CONFIG ##
#########################################
# Configure user nobody to match unRAID's settings
export DEBIAN_FRONTEND="noninteractive"
usermod -u 99 nobody
usermod -g 100 nobody
usermod -d /home nobody
chown -R nobody:users /home
#########################################
## FILES, SERVICES AND CONFIGURATION ##
#########################################
#config
cat <<'EOT' > /etc/my_init.d/config.sh
#!/bin/bash
if [[ $(cat /etc/timezone) != $TZ ]] ; then
echo "$TZ" > /etc/timezone
DEBIAN_FRONTEND="noninteractive" dpkg-reconfigure -f noninteractive tzdata
fi
EOT
# resilio
mkdir -p /etc/service/resilio
cat <<'EOT' > /etc/service/resilio/run
#!/bin/bash
umask 000
[[ ! -f /config/btsync.conf ]] && cp /tmp/btsync.conf /config/
[[ ! -d /config/.sync ]] && mkdir -p /config/.sync
[[ ! -f /config/.sync/debug.txt ]] && echo '0000' > /config/.sync/debug.txt
[[ "$(stat -c %Y /config/.sync/debug.txt 2>/dev/null || echo 0)" -lt "1454620500" ]] && echo '0000' > /config/.sync/debug.txt
chown -R nobody:users /opt/resilio /config
exec /sbin/setuser nobody /opt/resilio/rslsync --nodaemon --log "/config/btsync.log" --config "/config/btsync.conf"
EOT
cat <<'EOT' > /tmp/btsync.conf
{
"device_name": "unRAID",
"listening_port" : 5555,
"storage_path" : "/config/.sync",
"use_upnp" : false,
"download_limit" : 0,
"upload_limit" : 0,
"webui" :
{
"listen" : "0.0.0.0:8888"
}
}
EOT
chmod -R +x /etc/service/ /etc/my_init.d/
#########################################
## INSTALLATION ##
#########################################
# Install Resilio 2.6.3
mkdir -p /opt/resilio
curl -s -k -L "https://download-cdn.resilio.com/stable/linux-x64/resilio-sync_x64.tar.gz" | tar -xzf - -C /opt/resilio
#########################################
## CLEANUP ##
#########################################
# Clean APT install files
apt-get clean -y
rm -rf /var/lib/apt/lists/* /var/cache/* /var/tmp/*