-
Notifications
You must be signed in to change notification settings - Fork 0
/
install-deluge-ubuntu.sh
97 lines (73 loc) · 2.39 KB
/
install-deluge-ubuntu.sh
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#!/bin/sh
echo "****************************************************"
echo "Updating the package database"
echo "****************************************************"
sudo apt-get -q update
echo "****************************************************"
echo "Adding ppa:deluge-team/ppa"
echo "****************************************************"
sudo add-apt-repository -y ppa:deluge-team/ppa
echo "****************************************************"
echo "Installing Deluge Bittorrent Client with Web Interface"
echo "****************************************************"
sudo apt-get -yq install deluged deluge-webui curl
sudo adduser --system --group deluge
sudo gpasswd -a "$USER" deluge
echo "****************************************************"
echo "Creating deluged.service"
echo "****************************************************"
cat > /etc/systemd/system/deluged.service <<'EOF'
[Unit]
Description=Deluge Bittorrent Client Daemon
After=network-online.target
[Service]
Type=simple
User=deluge
Group=deluge
UMask=007
ExecStart=/usr/bin/deluged -d
Restart=on-failure
# Configures the time to wait before service is stopped forcefully.
TimeoutStopSec=300
[Install]
WantedBy=multi-user.target
EOF
echo "****************************************************"
echo "Starting deluged.service "
echo "****************************************************"
systemctl daemon-reload
systemctl start deluged
systemctl enable deluged
echo "****************************************************"
echo "Creating deluge-web.service"
echo "****************************************************"
cat > /etc/systemd/system/deluge-web.service <<'EOF'
[Unit]
Description=Deluge Bittorrent Client Web Interface
After=network-online.target
[Service]
Type=simple
User=deluge
Group=deluge
UMask=027
ExecStart=/usr/bin/deluge-web
Restart=on-failure
[Install]
WantedBy=multi-user.target
EOF
echo "****************************************************"
echo "Starting deluge-web.service"
echo "****************************************************"
systemctl daemon-reload
systemctl start deluge-web
systemctl enable deluge-web
echo "****************************************************"
echo "Deluge will be available on HTTP port 8112 by default."
echo " "
echo "Your IP address is:"
echo " "
curl ifconfig.me
echo ":8112"
echo " "
echo "The default password for deluge is deluge."
echo "****************************************************"