forked from Luctia/ezarr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·50 lines (45 loc) · 1.76 KB
/
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
#!/bin/bash
# Make users and group
sudo useradd sonarr -u 13001
sudo useradd radarr -u 13002
sudo useradd lidarr -u 13003
sudo useradd readarr -u 13004
sudo useradd mylar -u 13005
sudo useradd prowlarr -u 13006
sudo useradd qbittorrent -u 13007
sudo useradd jackett -u 13008
sudo useradd sabnzbd -u 13009
sudo groupadd mediacenter -g 13000
sudo usermod -a -G mediacenter sonarr
sudo usermod -a -G mediacenter radarr
sudo usermod -a -G mediacenter lidarr
sudo usermod -a -G mediacenter readarr
sudo usermod -a -G mediacenter mylar
sudo usermod -a -G mediacenter prowlarr
sudo usermod -a -G mediacenter qbittorrent
sudo usermod -a -G mediacenter jackett
sudo usermod -a -G mediacenter sabnzbd
# Make directories
sudo mkdir -pv docker/{sonarr,radarr,lidarr,readarr,mylar,prowlarr,qbittorrent,jackett,sabnzbd}-config
sudo mkdir -pv data/{torrents,media}/{tv,movies,music,books,comics}
sudo mkdir -pv data/{incomplete-,}downloads
# Set permissions
sudo chmod -R 775 data/
sudo chown -R $(id -u):mediacenter data/
sudo chown -R sonarr:mediacenter docker/sonarr-config
sudo chown -R radarr:mediacenter docker/radarr-config
sudo chown -R lidarr:mediacenter docker/lidarr-config
sudo chown -R readarr:mediacenter docker/readarr-config
sudo chown -R mylar:mediacenter docker/mylar-config
sudo chown -R prowlarr:mediacenter docker/prowlarr-config
sudo chown -R qbittorrent:mediacenter docker/qbittorrent-config
sudo chown -R jackett:mediacenter docker/jackett-config
sudo chown -R sabnzbd:mediacenter docker/sabnzbd-config
echo "UID=$(id -u)" >> .env
# remove media directories and symlink it to NFS mount
sudo rm -rf data/media
sudo ln -s /mnt/media1/Video data/media
sudo cp ezarr.service /etc/systemd/system/ezarr.service
sudo systemctl daemon-reload
sudo systemctl enable ezarr
sudo systemctl status ezarr