-
Notifications
You must be signed in to change notification settings - Fork 10
/
download-clients-installer.sh
executable file
·509 lines (459 loc) · 14.6 KB
/
download-clients-installer.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
#!/bin/bash
clear
echo "
___ ____ _ _ ____ _ _ _ ____ ___ ____ _ _ ____ ____
/ |___ | | [__ | |\ | [__ | |__| | | |___ |__/
/__ |___ |__| ___] | | \| ___] | | | |___ |___ |___ | \
"
#This script will install download clients in docker.
######################################################################
#Functions List
noanswer () { echo "Skipping..." ; }
updatesys () { yes | sudo apt-get update && sudo apt-get upgrade; }
######################################################################
echo "This script assumes you have your docker files located in your /home/$USER/raspi-docker folder."
echo "If your folder is located elsewhere, you will need to change the location of your docker-compose files in this script."
echo "This script follows my other guide of insatlling Docker and Mullvad VPN. Visit https://github.com/LordZeuss/raspi-docker for more info."
echo " "
echo "NOTE: With this script, it will default to downloading in the /home/$USER/Downloads folder."
echo "NOTE: The config files will default to /home/$USER/raspi-docker/qbittorrent unless otherwise changed in the script."
echo "I recommend changing the locations of downloads and the config file location if yours is in an alternate location."
echo " "
echo "This Script assumes your timezone is US/Central. You may need to modify."
######################################################################
#Update the system
echo " "
echo " "
echo "Would you like to update your system (Recommended)? (y/n/e)"
echo " "
echo "y=yes | n=no | f=Change-container-volumes-&-location | e=exit-program"
read -n1 yesorno
if [ "$yesorno" = y ]; then
updatesys
echo "Update Successful."
elif [ "$yesorno" = n ]; then
echo " "
echo "Skipping..."
elif [ "$yesorno" = e ]; then
echo " "
echo "Goodbye!"
exit 1
else
echo " "
echo "Not a valid answer. Exiting..."
exit 1
fi
######################################################################
#Test if Docker is working and installed
echo "Would you like to check if Docker is working(Recommended)? (y/n/e)"
read -n1 yesorno
if [ "$yesorno" = y ]; then
echo 'Checking Docker version...'
docker version
docker-compose -v
echo " "
echo "If no errors occured, Docker should be good to go."
echo "If an error occured, try running the docker-troubleshoot-fix.sh script."
echo " "
elif [ "$yesorno" = n ]; then
echo " "
echo "Skipping..."
elif [ "$yesorno" = e ]; then
echo " "
echo "Goodbye!"
exit 1
else
echo " "
echo "Not a valid answer. Exiting..."
exit 1
fi
######################################################################
#Install qBittorrent
echo "Would you like install qBittorrent? (y/n/f/e)"
read -n1 yesorno
if [ "$yesorno" = y ]; then
mkdir /home/$USER/raspi-docker/qbittorrent
echo "qbittorrent:
container_name: qbittorrent
image: hotio/qbittorrent
ports:
- 8282:8080
environment:
- PUID=1001
- PGID=100
- UMASK=002
- TZ=US/Central
volumes:
- /home/$USER/raspi-docker/qbittorrent:/config
- /home/$USER/raspi-docker/downloads:/downloads
restart: unless-stopped" >> /home/$USER/raspi-docker/docker-compose.yml #replace /home/$USER/raspi-docker/docker-compose.yml with the location of your docker-compose.yml file
echo " " >> /home/$USER/raspi-docker/docker-compose.yml #replace /home/$USER/raspi-docker/docker-compose.yml with the location of your docker-compose.yml file
echo " "
echo "Successfully Added"
elif [ "$yesorno" = n ]; then
echo " "
echo "Skipping..."
elif [ "$yesorno" = f ]; then
echo " "
read -n1 -p "You have selected to change the location/volumes of the container. Would you like to coninue? (y/n) " fix
if [ "$fix" = y ]; then
echo " "
read -p "Enter the location of the docker-compose.yml file: " qbitanswer
read -p "Enter the new location for config: " qbitconfig
read -p "Enter the new location for downloads: " qbitdl
sleep 1
echo "qbittorrent:
container_name: qbittorrent
image: hotio/qbittorrent
ports:
- 8282:8080
environment:
- PUID=1001
- PGID=100
- UMASK=002
- TZ=US/Central
volumes:
- $qbitocnfig:/config
- $qbitdl:/downloads
restart: unless-stopped" >> $qbitanswer
echo " " >> $qbitanswer
echo " "
echo "Done."
echo " "
elif [ "$fix" = n ]; then
echo " "
echo "Not adding qBittorrent to any file."
source download-client-installer.sh
return
else
echo " "
echo "Goodbye!"
exit 1
fi
elif [ "$yesorno" = e ]; then
echo " "
echo "Goodbye!"
exit 1
else
echo " "
echo "Not a valid answer. Exiting..."
exit 1
fi
#Install Transmission
echo "Would you like install Transmission? (y/n/f/e)"
read -n1 yesorno
if [ "$yesorno" = y ]; then
mkdir /home/$USER/raspi-docker/transmission
mkdir /home/$USER/raspi-docker/transmission/config
echo "transmission:
image: linuxserver/transmission
container_name: transmission
environment:
- PUID=1000
- PGID=1000
- TZ=UTC
- TRANSMISSION_WEB_HOME=/combustion-release/ #optional
# - USER=username #optional
# - PASS=password #optional
volumes:
- ./home/$USER/raspi-docker/transmission/config:/config
- ./home/$USER/raspi-docker/downloads:/downloads
- ./downloads/TransmissionWatchFolder:/watch
ports:
- 9091:9091
- 51413:51413
- 51413:51413/udp
restart: unless-stopped" >> /home/$USER/raspi-docker/docker-compose.yml #replace /home/$USER/raspi-docker/docker-compose.yml with the location of your docker-compose.yml file
echo " " >> /home/$USER/raspi-docker/docker-compose.yml #replace /home/$USER/raspi-docker/docker-compose.yml with the location of your docker-compose.yml file
echo " "
echo "Successfully Added"
elif [ "$yesorno" = n ]; then
echo " "
echo "Skipping..."
elif [ "$yesorno" = f ]; then
echo " "
read -n1 -p "You have selected to change the location/volumes of the container. Would you like to coninue? (y/n) " fix
if [ "$fix" = y ]; then
echo " "
read -p "Enter the location of the docker-compose.yml file: " transmissionanswer
read -p "Enter the new location for config: " transmissionconfig
read -p "Enter the new location for downloads: " transmissiondl
sleep 1
echo "transmission:
image: linuxserver/transmission
container_name: transmission
environment:
- PUID=1000
- PGID=1000
- TZ=UTC
- TRANSMISSION_WEB_HOME=/combustion-release/ #optional
# - USER=username #optional
# - PASS=password #optional
volumes:
- $transmissionconfig:/config
- $transmissiondl:/downloads
- ./downloads/TransmissionWatchFolder:/watch
ports:
- 9091:9091
- 51413:51413
- 51413:51413/udp
restart: unless-stopped" >> $transmissionanswer
echo " " >> $transmissionanswer
echo " "
echo "Done."
echo "To add a username and password, edit the docker-config.yml file after adding. Disabled by default."
echo " "
elif [ "$fix" = n ]; then
echo " "
echo "Not adding Transmission to any file."
source download-client-installer.sh
return
else
echo " "
echo "Goodbye!"
exit 1
fi
elif [ "$yesorno" = e ]; then
echo " "
echo "Goodbye!"
exit 1
else
echo " "
echo "Not a valid answer. Exiting..."
exit 1
fi
######################################################################
#Install Deluge
echo "Would you like install Deluge? (y/n/f/e)"
read -n1 yesorno
if [ "$yesorno" = y ]; then
mkdir /home/$USER/raspi-docker/deluge
mkdir /home/$USER/raspi-docker/deluge/config
echo "deluge:
image: linuxserver/deluge
container_name: deluge
# network_mode: host
environment:
- PUID=1000
- PGID=1000
- TZ=UTC
- UMASK=022 #optional
- DELUGE_LOGLEVEL=error #optional
volumes:
- ./home/$USER/raspi-docker/deluge/config:/config
- ./home/$USER/raspi-config/downloads:/downloads
ports:
- 8112:8112
- 58846:58846
- 58946:58946" >> /home/$USER/raspi-docker/docker-compose.yml #replace /home/$USER/raspi-docker/docker-compose.yml with the location of your docker-compose.yml file
echo " " >> /home/$USER/raspi-docker/docker-compose.yml #replace /home/$USER/raspi-docker/docker-compose.yml with the location of your docker-compose.yml file
echo " "
echo "Successfully Added"
elif [ "$yesorno" = n ]; then
echo " "
echo "Skipping..."
elif [ "$yesorno" = f ]; then
echo " "
read -n1 -p "You have selected to change the location/volumes of the container. Would you like to coninue? (y/n) " fix
if [ "$fix" = y ]; then
echo " "
read -p "Enter the location of the docker-compose.yml file: " delugeanswer
read -p "Enter the new location for config: " delugeconfig
read -p "Enter the new location for downloads: " delugedl
sleep 1
echo "deluge:
image: linuxserver/deluge
container_name: deluge
# network_mode: host
environment:
- PUID=1000
- PGID=1000
- TZ=UTC
- UMASK=022 #optional
- DELUGE_LOGLEVEL=error #optional
volumes:
- $delugeconfig:/config
- $delugedl:/downloads
ports:
- 8112:8112
- 58846:58846
- 58946:58946" >> $delugeanswer
echo " " >> $delugeanswer
echo " "
echo "Done."
echo " "
elif [ "$fix" = n ]; then
echo " "
echo "Not adding Deluge to any file."
source download-client-installer.sh
return
else
echo " "
echo "Goodbye!"
exit 1
fi
elif [ "$yesorno" = e ]; then
echo " "
echo "Goodbye!"
exit 1
else
echo " "
echo "Not a valid answer. Exiting..."
exit 1
fi
######################################################################
#Install nzbget
echo "Would you like install NZBGet? (y/n/f/e)"
read -n1 yesorno
if [ "$yesorno" = y ]; then
mkdir /home/$USER/raspi-docker/nzbget
mkdir /home/$USER/raspi-docker/nzbget/config
echo "nzbget:
image: lscr.io/linuxserver/nzbget:latest
container_name: nzbget
environment:
- PUID=1000
- PGID=1000
- TZ=US/Central
- NZBGET_USER=admin #optional
- NZBGET_PASS=admin #optional
volumes:
- /home/$USER/raspi-docker/nzbget/config:/config
- /home/$USER/raspi-docker/downloads:/downloads #optional
ports:
- 6789:6789
restart: unless-stopped" >> /home/$USER/raspi-docker/docker-compose.yml #replace /home/$USER/raspi-docker/docker-compose.yml with the location of your docker-compose.yml file
echo " " >> /home/$USER/raspi-docker/docker-compose.yml #replace /home/$USER/raspi-docker/docker-compose.yml with the location of your docker-compose.yml file
echo " "
echo "Default username & password is admin"
echo " "
echo "Successfully Added"
elif [ "$yesorno" = n ]; then
echo " "
echo "Skipping..."
elif [ "$yesorno" = f ]; then
echo " "
read -n1 -p "You have selected to change the location/volumes of the container. Would you like to coninue? (y/n) " fix
if [ "$fix" = y ]; then
echo " "
read -p "Enter the location of the docker-compose.yml file: " nzbgetanswer
read -p "Enter the new location for config: " nzbgetconfig
read -p "Enter the new location for downloads: " nzbgetdown
read -p "Enter the login user-name: " nzbgetlogin
read -p "Enter the login password: " nzbgetpass
sleep 1
echo "nzbget:
image: lscr.io/linuxserver/nzbget:latest
container_name: nzbget
environment:
- PUID=1000
- PGID=1000
- TZ=US/Central
- NZBGET_USER=$nzbgetlogin #optional
- NZBGET_PASS=$nzbgetpass #optional
volumes:
- $nzbgetconfig:/config
- $nzbgetdown:/downloads #optional
ports:
- 6789:6789
restart: unless-stopped" >> $nzbgetanswer
echo " " >> $nzbgetanswer
echo " "
echo "Done."
echo " "
elif [ "$fix" = n ]; then
echo " "
echo "Not adding NZBGet to any file."
source download-client-installer.sh
return
else
echo " "
echo "Goodbye!"
exit 1
fi
elif [ "$yesorno" = e ]; then
echo " "
echo "Goodbye!"
exit 1
else
echo " "
echo "Not a valid answer. Exiting..."
exit 1
fi
#Install sabnzbd
echo "Would you like install SABnzbd? (y/n/f/e)"
read -n1 yesorno
if [ "$yesorno" = y ]; then
mkdir /home/$USER/raspi-docker/sabnzbd
mkdir /home/$USER/raspi-docker/sabnzbd/config
echo "sabnzbd:
image: lscr.io/linuxserver/sabnzbd:latest
container_name: sabnzbd
environment:
- PUID=1000
- PGID=1000
- TZ=US/Central
volumes:
- /home/$USER/raspi-docker/sabnzbd/config:/config
- /home/$USER/raspi-docker/downloads:/downloads #optional
ports:
- 8080:8080
restart: unless-stopped" >> /home/$USER/raspi-docker/docker-compose.yml #replace /home/$USER/raspi-docker/docker-compose.yml with the location of your docker-compose.yml file
echo " " >> /home/$USER/raspi-docker/docker-compose.yml #replace /home/$USER/raspi-docker/docker-compose.yml with the location of your docker-compose.yml file
echo " "
echo "Successfully Added"
elif [ "$yesorno" = n ]; then
echo " "
echo "Skipping..."
elif [ "$yesorno" = f ]; then
echo " "
read -n1 -p "You have selected to change the location/volumes of the container. Would you like to coninue? (y/n) " fix
if [ "$fix" = y ]; then
echo " "
read -p "Enter the location of the docker-compose.yml file: " sabanswer
read -p "Enter the new location for config: " sabconfig
read -p "Enter the new location for downloads: " sabdown
sleep 1
echo "sabnzbd:
image: lscr.io/linuxserver/sabnzbd:latest
container_name: sabnzbd
environment:
- PUID=1000
- PGID=1000
- TZ=US/Central
volumes:
- $sabconfig:/config
- $sabdown:/downloads #optional
ports:
- 8080:8080
restart: unless-stopped" >> $sabanswer
echo " " >> $sabanswer
echo " "
echo "Done."
echo " "
elif [ "$fix" = n ]; then
echo " "
echo "Not adding SABnzbd to any file."
source download-client-installer.sh
return
else
echo " "
echo "Goodbye!"
exit 1
fi
elif [ "$yesorno" = e ]; then
echo " "
echo "Goodbye!"
exit 1
else
echo " "
echo "Not a valid answer. Exiting..."
exit 1
fi
echo " "
echo " "
echo " "
echo "Installer Complete."
echo "To access Portainer, go to the IP of this device in a web-browser, port 9000. Ex: 192.168.1.18:9000"
echo " "
echo "Goodbye!"