-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathc-fu-setup.sh
792 lines (735 loc) · 43.4 KB
/
c-fu-setup.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
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
#!/bin/bash
#######################################
## Name: pi-setup script ##
## Author: C-Fu [email protected] ##
## Description: Automate fresh pi ##
## installs, make it easier to ##
## find common containers ##
## compatible for arm/pi and x86 ##
## Containers are cross-platform ##
## ##
## Note: Code designed for ##
## ultra-wide monitors, sorry! ##
#######################################
clear
echo -e "\e[7m\n\n
[----------------------------------------------------]
[------------------ Pi Setup Script------------------]
[------------------- \e[7mby C-Fu--------------------]
[----Make sure to git clone to \$HOME/c-fu-setup!----]
[----------------to start the script!----------------]
[----------------------------------------------------]
\e[0m"
#installing prerequisites! Duh shoud've been made available in x86 from the get-go wtf x64!
echo -e "Installing pre-requisite(s)... ignore any errors, for now..."
echo -e "Installing dialog..."
sudo apt install -y dialog
sudo yum install -y dialog
sudo pacman -Syu dialog
sudo apk add dialog
echo -e "Entering $HOME/c-fu-setup directory..."
cd $HOME/c-fu-setup
echo -e "[ C-Fu Setup is loading! ]"
sleep 3
clear
#Reset vars
instDocker="NO"
instDockerCompose="NO"
instRClone="NO"
instAfraid="NO"
instCtop="NO"
instPortainer="NO"
instNginxProxy="NO"
instOrganizr="NO"
instWordpress="NO"
instRadarr="NO"
instSonarr="NO"
instLidarr="NO"
instJackett="NO"
instruTorrent="NO"
instNavidrome="NO"
instNextcloudpi="NO"
instOverseerr="NO"
instDozzle="NO"
instCaddy="NO"
instWikijs="NO"
#init vars"
scriptDir="$HOME/c-fu-setup"
IP=`hostname -I | cut -f1 -d' '` #get first IP
containerName="hello-world"
containerNiceName="$(tr '[:lower:]' '[:upper:]' <<< ${containerName:0:1})${containerName:1}"
containerRepo= #nothing
cmd=(dialog --separate-output
--title "C-Fu's Setup script for common apps"
--checklist "Select software to install/update:
(WARNING: DO NOT RE-INSTALL DOCKER & DOCKER-COMPOSE THIS WAY!
Docker - Containerize your apps, it's the future!
RClone - mount your cloud storage easily
Afraid.org - set up a quick cron job, get your DDNS url+key first!
Portainer - manage your container the pro way
NginxProxyManager - add ssl to your DDNS!
Organizr - your personal start page to all of your web apps
WordPress - host your site from your house!
Radarr - organize your Movie files
Sonarr - organize your TVShows files
Lidarr - organize your Music files
Jackett - organize your media sources
ruTorrent - Torrent downloader for *arr+Jackett
Navidrome - web-based music player
Nextcloudpi - awesome office collaboration suite
Overseerr - Request your movies & tv shows from here
Dozzle - web-based & very lightweight docker logs monitor
Caddy - a super-fast reverse-proxy alternative to nginxpm
WikiJS - Dead simple wiki/documentation server
" 40 80 61
)
options=(1 "Docker & Docker Compose" off # any option can be set to default to "on"
2 "RClone - mount your GDrive One Drive MEGA AWS WEBDav etc" off
3 "Afraid.org - stupidly simple & free DDNS url! (soon!)" off
4 "[Docker] Portainer - manage containers" off
5 "[Docker] NginxProxyManager - reverse-proxy your containers" off
6 "[Docker] Organizr - your personal start page" off
7 "[Docker] WordPress - biggest site creator" off
8 "[Docker] Radarr - your movie organizer " off
9 "[Docker] Sonarr - your tv shows organizer " off
10 "[Docker] Lidarr - your music organizer " off
11 "[Docker] Jackett - your media download finder" off
12 "[Docker] ruTorrent - your Torrent downloader " off
13 "[Docker] Navidrome - web-based music player & server" off
14 "[Docker] NextCloudPi - awesome office collaboration suite" off
15 "[Docker] Overseerr - media requests management" off
16 "[Docker] Dozzle - lightweight docker logs web monitoring" off
17 "[Docker] Caddy - VERY lightweight reverse-proxy" off
18 "[Docker] Wiki.JS - Dead simple wiki/documentation site" off
)
choices=$("${cmd[@]}" "${options[@]}" 2>&1 >/dev/tty)
clear
for choice in $choices
do
case $choice in
1)
echo -e "\n\n\e[33m
[------------------------------------]
[ Installing Docker & Docker Compose ]
[------------------------------------]
"
#Install docker
curl -fsSL https://get.docker.com -o get-docker.sh && instDocker=YES || echo -e "Error! Did not get docker script!" && instDocker=NO
sudo sh get-docker.sh && instDocker=YES || echo -e "Error! Did not run script!" && instDocker=NO
sudo usermod -aG docker pi || sudo usermod -aG docker dietpi #just in case
#Install docker-compose
sudo apt install -y libffi-dev libssl-dev
sudo apt install -y python3 python3-pip
sudo apt remove -y python-configparser #not needed
echo -e "\e[33mInstalling Docker Compose. Will take some time..."
sudo pip3 -v install docker-compose && instDockerCompose=YES || echo -e "Error! Did not install docker-compose!" && instDockerCompose=NO
echo -e "\n\n"
if [ "$instDocker"="YES" ]; then
echo -e "\e[33m[Docker] install : DONE!"
else
echo -e "\e[31m[Docker] install : FAILED!"
fi
if [ "$instDockerCompose"="YES" ]; then
echo -e "\e[33m[Docker Compose] install : DONE!"
else
echo -e "\e[31m[Docker Compose] install : FAILED!"
fi
echo -e "\n\n"
sleep 2
;;
2)
echo -e "\n\n\e[33m
[------------------------------------]
[ Installing RClone ]
[------------------------------------]
"
#Install rclone
echo "\e[33mInstalling rclone..."
curl https://rclone.org/install.sh | sudo bash && instRClone=YES || echo -e "\e[31mError! Did not download RClone! Check your Internet connection! " && instRClone=NO
echo -e "\n\n"
if [ "$instRClone"="YES" ]; then
echo -e "\e[33m[RClone] install : DONE!"
else
echo -e "\e[31m[RClone] install : FAILED!"
fi
echo -e "\n\n"
sleep 2
;;
3)
echo -e "\n\n\e[33m
[------------------------------------]
[ Installing afraid.org DDNS ]
[------------------------------------]
"
#Probably later...
sleep 2
;;
4)
echo -e "\n\n\e[33m
[------------------------------------]
[ Installing Portainer ]
[------------------------------------]
"
##Only need to change $containerName and $containerRepo and repeat copy.. hopefully
##Portainer container changed to portainer-ce, so folder uses $containerAltName
containerName="portainer-ce"
containerAltName="portainer"
containerRepo="portainer/"
containerNiceName="$(tr '[:lower:]' '[:upper:]' <<< ${containerAltName:0:1})${containerAltName:1}"
#set installVar to whatever inst$containerNiceName value is
declare -n installVar=inst$containerNiceName
###Begin###
docker pull "$containerRepo$containerName" && \
echo -e "\e[33m[$containerNiceName]\e[39m pulled" || echo -e "\e[31m[$containerNiceName] cannot be downloaded!\e[39m"
echo -e "\e[33mCreating container directories from inside $HOME\e[39m"
mkdir ~/$containerAltName && echo -e "\e[33m[$containerNiceName]\e[39m folder created" || echo -e "\e[31m[$containerNiceName] folder cannot be created... it exists?\e[39m"
cp $containerAltName-docker-compose.yml ~/$containerAltName/docker-compose.yml || echo -e "\e[31m[$containerNiceName] yml cannot be created... it doesn't exist?\e[39m"
cd ~/$containerAltName && docker-compose up -d && installVar="YES" || echo -e "\e[31m[$containerNiceName] container cannot be started! Check docker-compose.yml!\e[39m"
if [ "$installVar"="YES" ]; then
echo -e "\e[33m[$containerNiceName]\e[39m is UP!\n\e[33m[$containerName]\e[39m deployed!"
else
echo -e "\e[31m[$containerNiceName] cannot be started! Check the docker-compose file!\e[39m"
fi
declare -n installVar=t #some random shit, aka undeclaring? unlinking? I have no idea what I'm doing lel
sleep 2
;;
5)
echo -e "\n\n\e[33m
[------------------------------------]
[ Installing NginxProxyManager ]
[------------------------------------]
"
## Only need to change $containerName and $containerRepo and repeat copy.. hopefully
## nginx-proxy-manager uses nginxproxy as the directory
containerName="nginx-proxy-manager"
containerAltName="nginxproxy"
containerRepo="jc21/"
containerNiceName="$(tr '[:lower:]' '[:upper:]' <<< ${containerName:0:1})${containerName:1}"
## Set installVar to whatever inst$containerNiceName value is
declare -n installVar=inst$containerNiceName
###Begin###
docker pull "$containerRepo$containerName" && \
echo -e "\e[33m[$containerNiceName]\e[39m pulled" || echo -e "\e[31m[$containerNiceName] cannot be downloaded!\e[39m"
echo -e "\e[33mCreating container directories from inside $HOME\e[39m"
mkdir ~/$containerAltName && echo -e "\e[33m[$containerNiceName]\e[39m folder created" || echo -e "\e[31m[$containerNiceName] folder cannot be created... it exists?\e[39m"
cp $containerAltName-docker-compose.yml ~/$containerAltName/docker-compose.yml || echo -e "\e[31m[$containerNiceName] yml cannot be created... it doesn't exist?\e[39m"
cd ~/$containerAltName && docker-compose up -d && installVar="YES" || echo -e "\e[31m[$containerNiceName] container cannot be started! Check docker-compose.yml!\e[39m"
if [ "$installVar"="YES" ]; then
echo -e "\e[33m[$containerNiceName]\e[39m is UP!\n\e[33m[$containerName]\e[39m deployed!"
else
echo -e "\e[31m[$containerNiceName] cannot be started! Check the docker-compose file!\e[39m"
fi
declare -n installVar=t #some random shit, aka undeclaring? unlinking? I have no idea what I'm doing lel
sleep 2
;;
6)
echo -e "\n\n\e[33m
[------------------------------------]
[ Installing Organizr ]
[------------------------------------]
"
##Only need to change $containerName and $containerRepo and repeat copy.. hopefully
containerName="organizr"
containerRepo="organizr/"
containerNiceName="$(tr '[:lower:]' '[:upper:]' <<< ${containerName:0:1})${containerName:1}"
#set installVar to whatever inst$containerNiceName value is
declare -n installVar=inst$containerNiceName
###Begin###
docker pull "$containerRepo$containerName" && \
echo -e "\e[33m[$containerNiceName]\e[39m pulled" || echo -e "\e[31m[$containerNiceName] cannot be downloaded!\e[39m"
echo -e "\e[33mCreating container directories from inside $HOME\e[39m"
mkdir ~/$containerName && echo -e "\e[33m[$containerNiceName]\e[39m folder created" || echo -e "\e[31m[$containerNiceName] folder cannot be created... it exists?\e[39m"
cp $containerName-docker-compose.yml ~/$containerName/docker-compose.yml || echo -e "\e[31m[$containerNiceName] yml cannot be created... it doesn't exist?\e[39m"
cd ~/$containerName && docker-compose up -d && installVar="YES" || echo -e "\e[31m[$containerNiceName] container cannot be started! Check docker-compose.yml!\e[39m"
if [ "$installVar"="YES" ]; then
echo -e "\e[33m[$containerNiceName]\e[39m is UP!\n\e[33m[$containerName]\e[39m deployed!"
else
echo -e "\e[31m[$containerNiceName] cannot be started! Check the docker-compose file!\e[39m"
fi
declare -n installVar=t #some random shit, aka undeclaring? unlinking? I have no idea what I'm doing lel
sleep 2
;;
7)
echo -e "\n\n\e[33m
[------------------------------------]
[ Installing WordPress ]
[------------------------------------]
"
##Only need to change $containerName and $containerRepo and repeat copy.. hopefully
containerName="wordpress"
containerName2="mariadb"
containerRepo=
containerRepo2="ghcr.io/linuxserver/"
containerNiceName="$(tr '[:lower:]' '[:upper:]' <<< ${containerName:0:1})${containerName:1}"
#set installVar to whatever inst$containerNiceName value is
declare -n installVar=inst$containerNiceName
echo -e "Pulling from $containerRepo$containerName..."
###Begin###
docker pull "$containerRepo$containerName" && docker pull "$containerRepo2$containerName2" \ ## WordPress needs two containers!
echo -e "\e[33m[$containerNiceName]\e[39m pulled" || echo -e "\e[31m[$containerNiceName] cannot be downloaded!\e[39m"
echo -e "\e[33mCreating $containerName container directories from inside $HOME\e[39m"
mkdir ~/$containerName && echo -e "\e[33m[$containerNiceName]\e[39m folder created" || echo -e "\e[31m[$containerNiceName] folder cannot be created... it exists?\e[39m"
cp $scriptDir/$containerName-docker-compose.yml ~/$containerName/docker-compose.yml || echo -e "\e[31m[$containerNiceName] yml cannot be created... it doesn't exist?\e[39m"
cd ~/$containerName && docker-compose up -d && installVar="YES" || echo -e "\e[31m[$containerNiceName] container cannot be started! Check docker-compose.yml!\e[39m"
if [ "$installVar"="YES" ]; then
echo -e "\e[33m[$containerNiceName]\e[39m is UP!\n\e[33m[$containerName]\e[39m deployed!"
else
echo -e "\e[31m[$containerNiceName] cannot be started! Check the docker-compose file!\e[39m"
fi
declare -n installVar=t #some random shit, aka undeclaring? unlinking? I have no idea what I'm doing lel
instWordpress="YES"
echo "instWordpress=$instWordpress"
sleep 2
;;
8)
echo -e "\n\n\e[33m
[------------------------------------]
[ Installing Radarr ]
[------------------------------------]
"
##Only need to change $containerName and $containerRepo and repeat copy.. hopefully
containerName="radarr"
containerRepo="ghcr.io/linuxserver/"
containerNiceName="$(tr '[:lower:]' '[:upper:]' <<< ${containerName:0:1})${containerName:1}"
#set installVar to whatever inst$containerNiceName value is
declare -n installVar=inst$containerNiceName
###Begin###
docker pull "$containerRepo$containerName" && \
echo -e "\e[33m[$containerNiceName]\e[39m pulled" || echo -e "\e[31m[$containerNiceName] cannot be downloaded!\e[39m"
echo -e "\e[33mCreating container directories from inside $HOME\e[39m"
mkdir ~/$containerName && echo -e "\e[33m[$containerNiceName]\e[39m folder created" || echo -e "\e[31m[$containerNiceName] folder cannot be created... it exists?\e[39m"
cp $containerName-docker-compose.yml ~/$containerName/docker-compose.yml || echo -e "\e[31m[$containerNiceName] yml cannot be created... it doesn't exist?\e[39m"
cd ~/$containerName && docker-compose up -d && installVar="YES" || echo -e "\e[31m[$containerNiceName] container cannot be started! Check docker-compose.yml!\e[39m"
if [ "$installVar"="YES" ]; then
echo -e "\e[33m[$containerNiceName]\e[39m is UP!\n\e[33m[$containerName]\e[39m deployed!"
else
echo -e "\e[31m[$containerNiceName] cannot be started! Check the docker-compose file!\e[39m"
fi
#declare -n installVar=t #some random shit, aka undeclaring? unlinking? I have no idea what I'm doing lel
sleep 2
;;
9)
echo -e "\n\n\e[33m
[------------------------------------]
[ Installing Sonarr ]
[------------------------------------]
"
##Only need to change $containerName and $containerRepo and repeat copy.. hopefully
containerName="sonarr"
containerRepo="ghcr.io/linuxserver/"
containerNiceName="$(tr '[:lower:]' '[:upper:]' <<< ${containerName:0:1})${containerName:1}"
#set installVar to whatever inst$containerNiceName value is
declare -n installVar=inst$containerNiceName
###Begin###
docker pull "$containerRepo$containerName" && \
echo -e "\e[33m[$containerNiceName]\e[39m pulled" || echo -e "\e[31m[$containerNiceName] cannot be downloaded!\e[39m"
echo -e "\e[33mCreating container directories from inside $HOME\e[39m"
mkdir ~/$containerName && echo -e "\e[33m[$containerNiceName]\e[39m folder created" || echo -e "\e[31m[$containerNiceName] folder cannot be created... it exists?\e[39m"
cp $containerName-docker-compose.yml ~/$containerName/docker-compose.yml || echo -e "\e[31m[$containerNiceName] yml cannot be created... it doesn't exist?\e[39m"
cd ~/$containerName && docker-compose up -d && installVar="YES" || echo -e "\e[31m[$containerNiceName] container cannot be started! Check docker-compose.yml!\e[39m"
if [ "$installVar"="YES" ]; then
echo -e "\e[33m[$containerNiceName]\e[39m is UP!\n\e[33m[$containerName]\e[39m deployed!"
else
echo -e "\e[31m[$containerNiceName] cannot be started! Check the docker-compose file!\e[39m"
fi
#declare -n installVar=t #some random shit, aka undeclaring? unlinking? I have no idea what I'm doing lel
sleep 2
;;
10)
echo -e "\n\n\e[33m
[------------------------------------]
[ Installing Lidarr ]
[------------------------------------]
"
##Only need to change $containerName and $containerRepo and repeat copy.. hopefully
containerName="lidarr"
containerRepo="ghcr.io/linuxserver/"
containerNiceName="$(tr '[:lower:]' '[:upper:]' <<< ${containerName:0:1})${containerName:1}"
#set installVar to whatever inst$containerNiceName value is
declare -n installVar=inst$containerNiceName
###Begin###
docker pull "$containerRepo$containerName" && \
echo -e "\e[33m[$containerNiceName]\e[39m pulled" || echo -e "\e[31m[$containerNiceName] cannot be downloaded!\e[39m"
echo -e "\e[33mCreating container directories from inside $HOME\e[39m"
mkdir ~/$containerName && echo -e "\e[33m[$containerNiceName]\e[39m folder created" || echo -e "\e[31m[$containerNiceName] folder cannot be created... it exists?\e[39m"
cp $containerName-docker-compose.yml ~/$containerName/docker-compose.yml || echo -e "\e[31m[$containerNiceName] yml cannot be created... it doesn't exist?\e[39m"
cd ~/$containerName && docker-compose up -d && installVar="YES" || echo -e "\e[31m[$containerNiceName] container cannot be started! Check docker-compose.yml!\e[39m"
if [ "$installVar"="YES" ]; then
echo -e "\e[33m[$containerNiceName]\e[39m is UP!\n\e[33m[$containerName]\e[39m deployed!"
else
echo -e "\e[31m[$containerNiceName] cannot be started! Check the docker-compose file!\e[39m"
fi
#declare -n installVar=t #some random shit, aka undeclaring? unlinking? I have no idea what I'm doing lel
sleep 2
;;
11)
echo -e "\n\n\e[33m
[------------------------------------]
[ Installing Jackett ]
[------------------------------------]
"
#instJackett="NO" #temp
###Assign variables and indirect variables###
containerName="jackett"
containerNiceName="$(tr '[:lower:]' '[:upper:]' <<< ${containerName:0:1})${containerName:1}"
containerRepo="ghcr.io/linuxserver/"
#set installVar to whatever inst$containerNiceName value is
declare -n installVar=inst$containerNiceName
###Begin###
docker pull "$containerRepo$containerName" && \
echo -e "\e[33m[$containerNiceName]\e[39m pulled" || echo -e "\e[31m[$containerNiceName] cannot be downloaded!\e[39m"
echo -e "\e[33mCreating container directories from inside $HOME\e[39m"
mkdir ~/$containerName && echo -e "\e[33m[$containerNiceName]\e[39m folder created" || echo -e "\e[31m[$containerNiceName] folder cannot be created... it exists?\e[39m"
cp $containerName-docker-compose.yml ~/$containerName/docker-compose.yml || echo -e "\e[31m[$containerNiceName] yml cannot be created... it doesn't exist?\e[39m"
cd ~/$containerName && docker-compose up -d && installVar="YES" || echo -e "\e[31m[$containerNiceName] container cannot be started! Check docker-compose.yml!\e[39m"
if [ "$installVar"="YES" ]; then
echo -e "\e[33m[$containerNiceName]\e[39m is UP!\n\e[33m[$containerName]\e[39m deployed!"
else
echo -e "\e[31m[$containerNiceName] cannot be started! Check the docker-compose file!\e[39m"
fi
#declare -n installVar=t #some random shit, aka undeclaring? unlinking? I have no idea what I'm doing lel
sleep 2
;;
12)
echo -e "\n\n\e[33m
[------------------------------------]
[ Installing ruTorrent ]
[------------------------------------]
"
#instJackett="NO" #temp
###Assign variables and indirect variables###
containerName="rutorrent"
containerNiceName="ruTorrent"
containerRepo="ghcr.io/linuxserver/"
#set installVar to whatever inst$containerNiceName value is
declare -n installVar=inst$containerNiceName
###Begin###
docker pull "$containerRepo$containerName" && \
echo -e "\e[33m[$containerNiceName]\e[39m pulled" || echo -e "\e[31m[$containerNiceName] cannot be downloaded!\e[39m"
echo -e "\e[33mCreating container directories from inside $HOME\e[39m"
mkdir ~/$containerName && echo -e "\e[33m[$containerNiceName]\e[39m folder created" || echo -e "\e[31m[$containerNiceName] folder cannot be created... it exists?\e[39m"
cp $containerName-docker-compose.yml ~/$containerName/docker-compose.yml || echo -e "\e[31m[$containerNiceName] yml cannot be created... it doesn't exist?\e[39m"
cd ~/$containerName && docker-compose up -d && installVar="YES" || echo -e "\e[31m[$containerNiceName] container cannot be started! Check docker-compose.yml!\e[39m"
if [ "$installVar"="YES" ]; then
echo -e "\e[33m[$containerNiceName]\e[39m is UP!\n\e[33m[$containerName]\e[39m deployed!"
else
echo -e "\e[31m[$containerNiceName] cannot be started! Check the docker-compose file!\e[39m"
fi
#declare -n installVar=t #some random shit, aka undeclaring? unlinking? I have no idea what I'm doing lel
sleep 2
;;
13)
echo -e "\n\n\e[33m
[------------------------------------]
[ Installing Navidrome ]
[------------------------------------]
"
#instJackett="NO" #temp
###Assign variables and indirect variables###
containerName="navidrome"
containerNiceName="$(tr '[:lower:]' '[:upper:]' <<< ${containerName:0:1})${containerName:1}"
containerRepo="deluan/"
#set installVar to whatever inst$containerNiceName value is
declare -n installVar=inst$containerNiceName
###Begin###
docker pull "$containerRepo$containerName" && \
echo -e "\e[33m[$containerNiceName]\e[39m pulled" || echo -e "\e[31m[$containerNiceName] cannot be downloaded!\e[39m"
echo -e "\e[33mCreating container directories from inside $HOME\e[39m"
mkdir ~/$containerName && echo -e "\e[33m[$containerNiceName]\e[39m folder created" || echo -e "\e[31m[$containerNiceName] folder cannot be created... it exists?\e[39m"
cp $containerName-docker-compose.yml ~/$containerName/docker-compose.yml || echo -e "\e[31m[$containerNiceName] yml cannot be created... it doesn't exist?\e[39m"
cd ~/$containerName && docker-compose up -d && installVar="YES" || echo -e "\e[31m[$containerNiceName] container cannot be started! Check docker-compose.yml!\e[39m"
if [ "$installVar"="YES" ]; then
echo -e "\e[33m[$containerNiceName]\e[39m is UP!\n\e[33m[$containerName]\e[39m deployed!"
else
echo -e "\e[31m[$containerNiceName] cannot be started! Check the docker-compose file!\e[39m"
fi
#declare -n installVar=t #some random shit, aka undeclaring? unlinking? I have no idea what I'm doing lel
sleep 2
;;
14)
echo -e "\n\n\e[33m
[------------------------------------]
[ Installing NextCloudPi ]
[------------------------------------]
"
#instJackett="NO" #temp
###Assign variables and indirect variables###
containerName="nextcloudpi"
containerNiceName="$(tr '[:lower:]' '[:upper:]' <<< ${containerName:0:1})${containerName:1}"
containerRepo="ownyourbits/"
#set installVar to whatever inst$containerNiceName value is
declare -n installVar=inst$containerNiceName
###Begin###
docker pull "$containerRepo$containerName" && \
echo -e "\e[33m[$containerNiceName]\e[39m pulled" || echo -e "\e[31m[$containerNiceName] cannot be downloaded!\e[39m"
echo -e "\e[33mCreating container directories from inside $HOME\e[39m"
mkdir ~/$containerName && echo -e "\e[33m[$containerNiceName]\e[39m folder created" || echo -e "\e[31m[$containerNiceName] folder cannot be created... it exists?\e[39m"
cp $containerName-docker-compose.yml ~/$containerName/docker-compose.yml || echo -e "\e[31m[$containerNiceName] yml cannot be created... it doesn't exist?\e[39m"
cd ~/$containerName && docker-compose up -d && installVar="YES" || echo -e "\e[31m[$containerNiceName] container cannot be started! Check docker-compose.yml!\e[39m"
if [ "$installVar"="YES" ]; then
echo -e "\e[33m[$containerNiceName]\e[39m is UP!\n\e[33m[$containerName]\e[39m deployed!"
else
echo -e "\e[31m[$containerNiceName] cannot be started! Check the docker-compose file!\e[39m"
fi
#declare -n installVar=t #some random shit, aka undeclaring? unlinking? I have no idea what I'm doing lel
sleep 2
;;
15)
echo -e "\n\n\e[33m
[------------------------------------]
[ Installing Overseerr ]
[------------------------------------]
"
#instJackett="NO" #temp
###Assign variables and indirect variables###
containerName="overseerr"
containerNiceName="$(tr '[:lower:]' '[:upper:]' <<< ${containerName:0:1})${containerName:1}"
containerRepo="hotio/"
#set installVar to whatever inst$containerNiceName value is
declare -n installVar=inst$containerNiceName
###Begin###
docker pull "$containerRepo$containerName" && \
echo -e "\e[33m[$containerNiceName]\e[39m pulled" || echo -e "\e[31m[$containerNiceName] cannot be downloaded!\e[39m"
echo -e "\e[33mCreating container directories from inside $HOME\e[39m"
mkdir ~/$containerName && echo -e "\e[33m[$containerNiceName]\e[39m folder created" || echo -e "\e[31m[$containerNiceName] folder cannot be created... it exists?\e[39m"
cp $containerName-docker-compose.yml ~/$containerName/docker-compose.yml || echo -e "\e[31m[$containerNiceName] yml cannot be created... it doesn't exist?\e[39m"
cd ~/$containerName && docker-compose up -d && installVar="YES" || echo -e "\e[31m[$containerNiceName] container cannot be started! Check docker-compose.yml!\e[39m"
if [ "$installVar"="YES" ]; then
echo -e "\e[33m[$containerNiceName]\e[39m is UP!\n\e[33m[$containerName]\e[39m deployed!"
else
echo -e "\e[31m[$containerNiceName] cannot be started! Check the docker-compose file!\e[39m"
fi
#declare -n installVar=t #some random shit, aka undeclaring? unlinking? I have no idea what I'm doing lel
sleep 2
;;
16)
echo -e "\n\n\e[33m
[------------------------------------]
[ Installing Dozzle ]
[------------------------------------]
"
#instJackett="NO" #temp
###Assign variables and indirect variables###
containerName="dozzle"
containerNiceName="$(tr '[:lower:]' '[:upper:]' <<< ${containerName:0:1})${containerName:1}"
containerRepo="amir20/"
#set installVar to whatever inst$containerNiceName value is
declare -n installVar=inst$containerNiceName
###Begin###
docker pull "$containerRepo$containerName" && \
echo -e "\e[33m[$containerNiceName]\e[39m pulled" || echo -e "\e[31m[$containerNiceName] cannot be downloaded!\e[39m"
echo -e "\e[33mCreating container directories from inside $HOME\e[39m"
mkdir ~/$containerName && echo -e "\e[33m[$containerNiceName]\e[39m folder created" || echo -e "\e[31m[$containerNiceName] folder cannot be created... it exists?\e[39m"
cp $containerName-docker-compose.yml ~/$containerName/docker-compose.yml || echo -e "\e[31m[$containerNiceName] yml cannot be created... it doesn't exist?\e[39m"
cd ~/$containerName && docker-compose up -d && installVar="YES" || echo -e "\e[31m[$containerNiceName] container cannot be started! Check docker-compose.yml!\e[39m"
if [ "$installVar"="YES" ]; then
echo -e "\e[33m[$containerNiceName]\e[39m is UP!\n\e[33m[$containerName]\e[39m deployed!"
else
echo -e "\e[31m[$containerNiceName] cannot be started! Check the docker-compose file!\e[39m"
fi
#declare -n installVar=t #some random shit, aka undeclaring? unlinking? I have no idea what I'm doing lel
sleep 2
;;
17)
echo -e "\n\n\e[33m
[------------------------------------]
[ Installing Caddy ]
[------------------------------------]
"
#instJackett="NO" #temp
##Assign variables and indirect variables###
###Caddy has no repo name
containerName="caddy"
containerNiceName="$(tr '[:lower:]' '[:upper:]' <<< ${containerName:0:1})${containerName:1}"
containerRepo="library/"
#set installVar to whatever inst$containerNiceName value is
declare -n installVar=inst$containerNiceName
###Begin###
docker pull "$containerName" && \
echo -e "\e[33m[$containerNiceName]\e[39m pulled" || echo -e "\e[31m[$containerNiceName] cannot be downloaded!\e[39m"
echo -e "\e[33mCreating container directories from inside $HOME\e[39m"
mkdir ~/$containerName && echo -e "\e[33m[$containerNiceName]\e[39m folder created" || echo -e "\e[31m[$containerNiceName] folder cannot be created... it exists?\e[39m"
cp $containerName-docker-compose.yml ~/$containerName/docker-compose.yml || echo -e "\e[31m[$containerNiceName] yml cannot be created... it doesn't exist?\e[39m"
##Additional caddy files
cp Caddyfile $HOME/$containerName/ || echo -e "\e[31m[$containerNiceName] Caddyfile cannot be created.. it doesn't exist?\e[39m"
cd ~/$containerName && docker-compose up -d && installVar="YES" || echo -e "\e[31m[$containerNiceName] container cannot be started! Check docker-compose.yml!\e[39m"
if [ "$installVar"="YES" ]; then
echo -e "\e[33m[$containerNiceName]\e[39m is UP!\n\e[33m[$containerName]\e[39m deployed!"
else
echo -e "\e[31m[$containerNiceName] cannot be started! Check the docker-compose file!\e[39m"
fi
#declare -n installVar=t #some random shit, aka undeclaring? unlinking? I have no idea what I'm doing lel
sleep 2
;;
18)
echo -e "\n\n\e[33m
[------------------------------------]
[ Installing WikiJS ]
[------------------------------------]
"
##Only need to change $containerName and $containerRepo and repeat copy.. hopefully
containerName="wikijs"
containerRepo="ghcr.io/linuxserver/"
containerNiceName="$(tr '[:lower:]' '[:upper:]' <<< ${containerName:0:1})${containerName:1}"
#set installVar to whatever inst$containerNiceName value is
declare -n installVar=inst$containerNiceName
echo -e "Pulling from $containerRepo$containerName..."
###Begin###
docker pull "$containerRepo$containerName" && docker pull "$containerRepo2$containerName2" \ ## WordPress needs two containers!
echo -e "\e[33m[$containerNiceName]\e[39m pulled" || echo -e "\e[31m[$containerNiceName] cannot be downloaded!\e[39m"
echo -e "\e[33mCreating $containerName container directories from inside $HOME\e[39m"
mkdir ~/$containerName && echo -e "\e[33m[$containerNiceName]\e[39m folder created" || echo -e "\e[31m[$containerNiceName] folder cannot be created... it exists?\e[39m"
cp $scriptDir/$containerName-docker-compose.yml ~/$containerName/docker-compose.yml || echo -e "\e[31m[$containerNiceName] yml cannot be created... it doesn't exist?\e[39m"
cd ~/$containerName && docker-compose up -d && installVar="YES" || echo -e "\e[31m[$containerNiceName] container cannot be started! Check docker-compose.yml!\e[39m"
if [ "$installVar"="YES" ]; then
echo -e "\e[33m[$containerNiceName]\e[39m is UP!\n\e[33m[$containerName]\e[39m deployed!"
else
echo -e "\e[31m[$containerNiceName] cannot be started! Check the docker-compose file!\e[39m"
fi
declare -n installVar=t #some random shit, aka undeclaring? unlinking? I have no idea what I'm doing lel
instWikijs="YES"
echo "instWikijs=$instWikijs"
sleep 2
;;
esac
done
echo -e "\n\e[32m
[------------------------------------]
[ ALL DONE! ]
[ https://github.com/C-Fu/pi-setup ]
[------------------------------------]
\e[39m\n"
#echo -e "\e[32mCheck running containers..."
#docker ps
echo "instDocker= $instDocker"
echo "instDockerCompose= $instDockerCompose"
echo "instRClone= $instRClone"
echo "instPortainer= $instPortainer"
echo "instNginxProxy= $instNginxProxy"
echo "instOrganizr= $instOrganizr"
echo "instWordpress= $instWordpress"
echo "instRadarr= $instRadarr"
echo "instSonarr= $instSonarr"
echo "instLidarr= $instLidarr"
echo "instJackett= $instJackett"
echo "instruTorrent= $instruTorrent"
echo "instNavidrome= $instNavidrome"
echo "instNextcloudpi= $instNextcloudpi"
echo "instOverseerr= $instOverseerr"
echo "instDozzle= $instDozzle"
echo "instCaddy= $instCaddy"
echo "instWikijs= $instWikijs"
#SCRIPT CHECK AND INFO DISPLAY
###Docker###
if [ "instDocker" = "YES" ] ; then
echo -e "\e[32m[INSTALLED] \e[33m[Docker]\e[39m can be run by using
\e[33mdocker run -d --name something \\
-p hostportno:containerport \\
-v hostdir:containerdir \\
repo/container\e[39m (one line)
then open up browser at \e[34m$IP:HostPortNo\e[39m"
fi
###Docker Compose###
if [ "instDockerCompose" = "YES" ];then
echo -e "\e[32m[INSTALLED] \e[33m[Docker Compose]\e[39m can be run by
editing your \e[33mdocker-compose.yml\e[39m file, then do
\e[33mdocker-compose up -d\e[39m to start, or
\e[33mdocker-compose down --rmi local\e[39m to uninstall and remove container"
fi
###RClone###
if [ "instRClone" = "YES" ];then
echo -e "\e[32m[INSTALLED] \e[33m[RClone]\e[39m can be run by using
\e[33mrclone config\e[39m, and then \e[33mrclone cp\e[39m, \e[33mrclone mv\e[39m,
\e[33mrclone lsd\e[39m, \e[33mrclone ls\e[39m, \e[33mrclone mount\e[39m."
fi
###Portainer###
if [ "$instPortainer" = "YES" ];then
echo -e "\e[32m[INSTALLED] \e[33m[portainer]\e[39m deployed at \e[34m$IP:9000\e[39m."
fi
###NginxProxyManager###
if [ "$instNginxproxymanager" = "YES" ];then
echo -e "\e[32m[INSTALLED] \e[33m[nginx-proxy-manager]\e[39m deployed at \e[34m$IP:181\e[39m.
Your IP is \e[34m$IP\e[39m.
Port-forward/Add virtual server port 80 and 443 to \e[34m$IP:180\e[39m and \e[34m$IP:1443\e[39m
from inside your router's WebUI page, usually at
\e[34m192.168.0.1 \e[39mor \e[34m192.168.1.1 \e[39mor \e[34m192.168.0.254\e[39m."
fi
###Organizr###
if [ "$instOrganizr" = "YES" ]; then
echo -e "\e[32m[INSTALLED] \e[33m[organizr]\e[39m deployed at \e[34m$IP:88\e[39m.
This should/can be your front page, to access other services like
WordPress at $IP:8484 and NginxProxyManager WebUI at $IP:181.
Port-forward/Add virtual server
port \e[34m88\e[39m to \e[34m$IP:88\e[39m
from inside your router's WebUI page, usually at
\e[34m192.168.0.1 \e[39mor \e[34m192.168.1.1 \e[39mor \e[34m192.168.0.254\e[39m.
Then use NginxProxyManager to set ssl at http://$IP:88 to your DDNS address.
Free web address at afraid.org"
fi
###WordPress###
if [ "$instWordpress" = "YES" ]; then
echo -e "\e[32m[INSTALLED] \e[33m[wordpress]\e[39m deployed at \e[34m$IP:8484\e[39m.
Port-forward/Add virtual server
port \e[34m8484\e[39m to \e[34m$IP:8484\e[39m
from inside your router's WebUI page, usually at
\e[34m192.168.0.1 \e[39mor \e[34m192.168.1.1 \e[39mor \e[34m192.168.0.254\e[39m.
"
fi
###Radarr###
if [ "$instRadarr" = "YES" ]; then
echo -e "\e[32m[INSTALLED] \e[33m[Radarr]\e[39m deployed at \e[34m$IP:7878\e[39m.
Works best with Sonarr and Lidarr and Jackett and a Downloader, like ruTorrent"
fi
###Sonarr###
if [ "$instSonarr" = "YES" ]; then
echo -e "\e[32m[INSTALLED] \e[33m[Sonarr]\e[39m deployed at \e[34m$IP:8989\e[39m.
Works best with Radarr and Lidarr and Jackett and a Downloader, like ruTorrent"
fi
###Lidarr###
if [ "$instLidarr" = "YES" ]; then
echo -e "\e[32m[INSTALLED] \e[33m[Lidarr]\e[39m deployed at \e[34m$IP:8686\e[39m.
Works best with Sonarr and Radarr and Jackett and a Downloader, like ruTorrent"
fi
###Jackett###
if [ "$instJackett" = "YES" ]; then
echo -e "\e[32m[INSTALLED] \e[33m[Jackett]\e[39m deployed at \e[34m$IP:9117\e[39m.
Works best with Sonarr and Radarr and Lidarr and a Downloader, like ruTorrent"
fi
###ruTorrent###
if [ "instruTorrent" = "1" ]; then
echo -e "\e[32m[INSTALLED] \e[33m[ruTorrent]\e[39m deployed at \e[34m$IP:580\e[39m.
Port-forward/Add virtual server for these ports:
\e[34m5000\e[39m - scgi port
\e[34m56881\e[39m - tcp&udp port for downloading
\e[34m580\e[39m - WebUI port, not necessary unless you want public access (DANGER!)
Access via web browser at \e[34m$IP:580\e[39m"
fi
##NextCloudPi##
if [ "$instNextcloudpi" = "YES" ]; then
echo -e "\e[32m[INSTALLED] \e[33m[NextCloudPi]\e[39m deployed at \e[34m$IP:44443\e[39m.
Visit \e[34m$IP:44443\e[39m to set up your NCP before going to \e[34m$IP:4443\e[39m"
fi
##Overseerr##
if [ "$instOverseerr" = "YES" ]; then
echo -e "\e[32m[INSTALLED] \e[33m[Overseerr]\e[39m deployed at \e[34m$IP:5055\e[39m."
fi
##Dozzle##
if [ "$instDozzle" = "YES" ]; then
echo -e "\e[32m[INSTALLED] \e[33m[Dozzle]\e[39m deployed at \e[34m$IP:9999\e[39m."
fi
##Caddy##
if [ "$instCaddy" = "YES" ]; then
echo -e "\e[32m[INSTALLED] \e[33m[Caddy]\e[39m deployed. Set your router to
port-forward port 80 and 443 to \e[34m$IP:280\e[39m & \e[34m$IP:2443\e[39m.
Caddy uses Caddyfile to configure your reverse-proxy needs, for example:
$ cat Caddyfile
\e[31myour.ddns.url\e[39m
\e[92mreverse_proxy\e[39m \e[34mlocalhost:88\e[39m \e[90m#Your [Organizr] page as the homepage of \e[34mhttps://your.ddns.url/\e[39m
\e[92mreverse_proxy\e[39m \e[34m/web/* localhost:8484\e[39m \e[90m#Your [WordPress] page at \e[34mhttps://your.ddns.url/web\e[39m
"
fi
##WikiJS##
if [ "$instWikijs" = "YES" ]; then
echo -e "\e[32m[INSTALLED] \e[33m[WikiJS]\e[39m deployed at \e[34m$IP:3000\e[39m."
fi
exit