618 lines
17 KiB
Bash
Executable File
618 lines
17 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# Get script working directory
|
|
# (when called from a different directory)
|
|
WDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >>/dev/null 2>&1 && pwd)"
|
|
APTOPT=
|
|
CONFIG=0
|
|
SCRIPT_NAME=$(basename -- $0)
|
|
SCRIPT_NAME=${SCRIPT_NAME%%.*}
|
|
CONFIG_FILE_NAME="${SCRIPT_NAME}.cfg"
|
|
CONFIG_FILE_TEMPLATE="$WDIR/${CONFIG_FILE_NAME}.example"
|
|
|
|
step_config() {
|
|
checkVpn
|
|
|
|
initSeqConfig -t "$CONFIG_FILE_NAME" "$CONFIG_FILE_TEMPLATE"
|
|
if [ $? -eq 0 ] ; then
|
|
CONFIG=1
|
|
else
|
|
# End if no configuration file exists
|
|
[ $DRY -eq 0 ] && return -1
|
|
fi
|
|
[ $QUIET -ne 0 ] && APTOPT="-y"
|
|
return 0
|
|
}
|
|
|
|
step_1_info() { echo "Install mono"; }
|
|
step_1_alias() { ALIAS="install"; }
|
|
step_1() {
|
|
exe apt install apt-transport-https dirmngr gnupg ca-certificates
|
|
exe apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
|
|
|
|
exep "echo \"deb https://download.mono-project.com/repo/debian stable-buster main\" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list"
|
|
|
|
exe apt update
|
|
# This will apparently be managed by the installation of sonarr later
|
|
# (https://sonarr.tv/#downloads-v3-linux Chapter 1)
|
|
#exe apt install mono-complete
|
|
}
|
|
|
|
step_2_info() { echo "Install mediainfo"; }
|
|
step_2() {
|
|
exe wget https://mediaarea.net/repo/deb/repo-mediaarea_1.0-16_all.deb -O /tmp/repo-mediaarea_all.deb
|
|
|
|
exe dpkg -i /tmp/repo-mediaarea_all.deb
|
|
|
|
exe apt update
|
|
exe apt install mediainfo
|
|
}
|
|
|
|
step_3_info() { echo "Add system user"; }
|
|
step_3() {
|
|
exe adduser --system $DLD_USER --group --home "${DLD_CONFDIR}"
|
|
}
|
|
|
|
step_4_info() {
|
|
echo "Install sonarr"
|
|
echoinfo "Default port: 8989"
|
|
}
|
|
step_4() {
|
|
exe apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 2009837CBFFD68F45BC180471F4F90DE2A9B4BF8
|
|
exep "echo \"deb https://apt.sonarr.tv/debian buster main\" | tee /etc/apt/sources.list.d/sonarr.list"
|
|
exe apt update
|
|
exe apt install sonarr
|
|
# Start of sonar must be managed by VPN service
|
|
exe service sonarr stop
|
|
exe systemctl disable sonarr
|
|
}
|
|
|
|
step_5_info() {
|
|
echo "Install radarr for arm64"
|
|
echoinfo "Default port: 7878"
|
|
}
|
|
step_5() {
|
|
# nightly https://radarr.servarr.com/v1/update/nightly/updatefile?os=linux&runtime=netcore&arch=arm64
|
|
# develop https://radarr.servarr.com/v1/update/develop/updatefile?os=linux&runtime=netcore&arch=arm64
|
|
exe curl -sL "https://radarr.servarr.com/v1/update/master/updatefile?os=linux&runtime=netcore&arch=arm64" \
|
|
-o /tmp/Radarr.tgz
|
|
|
|
exe tar xvzf /tmp/Radarr.tgz -C "${DLD_DIR}/"
|
|
exe mv ${DLD_DIR}/Radarr "${DLD_DIR}/radarr"
|
|
exe chown -R ${DLD_USER}:${DLD_USER} "${DLD_DIR}/radarr"
|
|
}
|
|
|
|
step_6_info() { echo "Create radarr service"; }
|
|
step_6() {
|
|
local radarrConf="${DLD_CONFDIR}/radarr"
|
|
local radarrServiceLoc="/etc/systemd/system/radarr.service"
|
|
|
|
exe mkdir -p "$radarrConf"
|
|
exe chown -R $DLD_USER: "$radarrConf"
|
|
|
|
addConf -s "$radarrService" "$radarrServiceLoc"
|
|
exe systemctl daemon-reload
|
|
}
|
|
radarrService="[Unit]
|
|
Description=Radarr Daemon
|
|
After=syslog.target network.target
|
|
Wants=transmission.service jackett.service nzbget.service
|
|
StartLimitIntervalSec=0
|
|
|
|
[Service]
|
|
User=\$DLD_USER
|
|
Group=\$DLD_USER
|
|
|
|
Type=simple
|
|
|
|
ExecStart=\${DLD_DIR}/radarr/Radarr -nobrowser -data=\$radarrConf
|
|
TimeoutStopSec=20
|
|
KillMode=process
|
|
Restart=on-failure
|
|
RestartSec=5
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|
|
Alias=radarr.service"
|
|
|
|
step_7_info() {
|
|
echo "Install jackett for arm64"
|
|
echoinfo "Default port: 9117"
|
|
}
|
|
step_7() {
|
|
local jTar="/tmp/Jackett.tgz"
|
|
local jUrl="https://github.com/Jackett/Jackett/releases/latest/download/Jackett.Binaries.LinuxARM64.tar.gz"
|
|
|
|
[ ! -e "$jTar" ] && exe curl -sL "$jUrl" -o "$jTar"
|
|
|
|
exe tar xvzf "$jTar" -C "${DLD_DIR}"
|
|
exe mv "${DLD_DIR}/Jackett" "${DLD_DIR}/jackett"
|
|
exe chown -R ${DLD_USER}:${DLD_USER} "${DLD_DIR}/jackett"
|
|
}
|
|
|
|
step_8_info() { echo "Create jackett service"; }
|
|
step_8() {
|
|
local jackettServiceLoc="/etc/systemd/system/jackett.service"
|
|
local lService=`eval "echo \"$jackettService\""`
|
|
addConf -s "$lService" "$jackettServiceLoc"
|
|
exe systemctl daemon-reload
|
|
}
|
|
jackettService="[Unit]
|
|
Description=Jackett Daemon
|
|
After=syslog.target network.target
|
|
StartLimitIntervalSec=0
|
|
|
|
[Service]
|
|
User=\$DLD_USER
|
|
Group=\$DLD_USER
|
|
|
|
Type=simple
|
|
SyslogIdentifier=jackett
|
|
Restart=on-failure
|
|
RestartSec=5
|
|
WorkingDirectory=\${DLD_DIR}/jackett
|
|
ExecStart=/bin/sh \${DLD_DIR}/jackett/jackett_launcher.sh
|
|
TimeoutStopSec=30
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|
|
Alias=jackett.service"
|
|
|
|
step_9_info() {
|
|
echo "Install NZBGet for arm64"
|
|
echoinfo "Default port: 6789"
|
|
}
|
|
step_9() {
|
|
exe wget -q https://nzbget.net/download/nzbget-latest-bin-linux.run -O /tmp/nzbget-latest-bin-linux.run
|
|
|
|
# you can skip --arch aarch64 to auto-detect the architecture
|
|
exe sh /tmp/nzbget-latest-bin-linux.run --destdir "${DLD_DIR}/nzbget" --arch aarch64
|
|
|
|
exe chown -R ${DLD_USER}:${DLD_USER} "${DLD_DIR}/nzbget"
|
|
}
|
|
|
|
step_10_info() { echo "Create NZBGet service"; }
|
|
step_10() {
|
|
local nzbServiceLoc="/etc/systemd/system/nzbget.service"
|
|
local lService=`eval "echo \"$nzbService\""`
|
|
local nzbConfOri="${DLD_DIR}/nzbget/nzbget.conf"
|
|
local nzbConf="${DLD_CONFDIR}/nzbget/nzbget.conf"
|
|
exe mkdir -p "$(dirname "$nzbConf")"
|
|
exe chown -R $DLD_USER: "$(dirname "$nzbConf")"/..
|
|
|
|
addConf -s "$lService" "$nzbServiceLoc"
|
|
exe systemctl daemon-reload
|
|
|
|
exe cp -n "$nzbConfOri" "$nzbConf"
|
|
}
|
|
nzbService="[Unit]
|
|
Description=NZBGet Daemon
|
|
After=syslog.target network.target
|
|
StartLimitIntervalSec=0
|
|
|
|
[Service]
|
|
# Change the user and group variables here.
|
|
User=\$DLD_USER
|
|
Group=\$DLD_USER
|
|
|
|
Type=forking
|
|
|
|
# Pass any command line arguments etc.
|
|
ExecStart=\${DLD_DIR}/nzbget/nzbget -D -c \${DLD_CONFDIR}/nzbget/nzbget.conf
|
|
ExecStop=\${DLD_DIR}/nzbget/nzbget -Q -c \${DLD_CONFDIR}/nzbget/nzbget.conf
|
|
ExecReload=\${DLD_DIR}/nzbget/nzbget -O -c \${DLD_CONFDIR}/nzbget/nzbget.conf
|
|
TimeoutStopSec=20
|
|
KillMode=process
|
|
Restart=on-failure
|
|
RestartSec=5
|
|
|
|
# Sandboxing ... (see https://www.freedesktop.org/software/systemd/man/systemd.exec.html for more info)
|
|
ReadWritePaths=\${DLD_DIR}/nzbget \${DLD_CONFDIR}/nzbget /mnt
|
|
ProtectSystem=strict
|
|
PrivateDevices=true
|
|
ProtectHome=true
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target sonarr.service radarr.service
|
|
Alias=nzbget.service
|
|
#RequiredBy=sonarr.service radarr.service"
|
|
|
|
step_11_info() {
|
|
echo "Install lidarr for arm64"
|
|
echoinfo "Default port: 8686"
|
|
}
|
|
step_11() {
|
|
local lidarrDeps="libchromaprint-tools"
|
|
local lidarrUrl="https://lidarr.servarr.com/v1/update/develop/updatefile?os=linux&runtime=netcore&arch=arm64"
|
|
exe curl -sL "$lidarrUrl" -o /tmp/Lidarr.tgz
|
|
endReturn -o "Download failed"
|
|
|
|
exe apt install $lidarrDeps $APTOPT
|
|
|
|
exe tar xvzf /tmp/Lidarr.tgz -C "${DLD_DIR}/"
|
|
exe mv "${DLD_DIR}/Lidarr" "${DLD_DIR}/lidarr"
|
|
exe chown -R ${DLD_USER}:${DLD_USER} "${DLD_DIR}/lidarr"
|
|
}
|
|
|
|
step_12_info() { echo "Create lidarr service"; }
|
|
step_12() {
|
|
local lidarrConf="${DLD_CONFDIR}/lidarr"
|
|
local lidarrServiceLoc="/etc/systemd/system/lidarr.service"
|
|
local lService=`eval "echo \"$lidarrService\""`
|
|
exe mkdir -p "$lidarrConf"
|
|
exe chown -R $DLD_USER: "$lidarrConf"
|
|
|
|
addConf -s "$lService" "$lidarrServiceLoc"
|
|
exe systemctl daemon-reload
|
|
}
|
|
lidarrService="[Unit]
|
|
Description=Lidarr Daemon
|
|
After=syslog.target network.target
|
|
Wants=transmission.service jackett.service nzbget.service
|
|
StartLimitIntervalSec=0
|
|
|
|
[Service]
|
|
User=\$DLD_USER
|
|
Group=\$DLD_USER
|
|
|
|
Type=simple
|
|
|
|
ExecStart=\${DLD_DIR}/lidarr/Lidarr -nobrowser -data=\$lidarrConf
|
|
TimeoutStopSec=20
|
|
KillMode=process
|
|
Restart=on-failure
|
|
RestartSec=5
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|
|
Alias=lidarr.service"
|
|
|
|
|
|
step_13_info() { echo "Install bazarr dependencies"; }
|
|
step_13() {
|
|
local bazarrDeps="python3-pip python3-distutils python3-venv ffmpeg"
|
|
#local bazarrDeps+=" libxml2-dev libxslt1-dev python3-libxml2 python3-lxml libatlas-base-dev"
|
|
|
|
exe apt install $bazarrDeps $APTOPT
|
|
}
|
|
|
|
step_14_info() { echo "Install bazarr"; }
|
|
step_14() {
|
|
local bazarrServiceLoc="/etc/systemd/system/bazarr.service"
|
|
local lService=`eval "echo \"$bazarrService\""`
|
|
local bazarrVenv="${DLD_DIR}/bazarr"
|
|
local bazarrDir="${bazarrVenv}/bazarr"
|
|
|
|
local bazarrGitUrl="https://github.com/morpheus65535/bazarr.git"
|
|
|
|
exe python3 -m venv "$bazarrVenv"
|
|
endReturn -o $? "Creating virtual environment failed"
|
|
|
|
exe git clone $bazarrGitUrl "$bazarrDir"
|
|
exe chown -R $DLD_USER: "$bazarrVenv"
|
|
exe sudo -u $DLD_USER ${bazarrVenv}/bin/pip install --upgrade pip
|
|
exe sudo -u $DLD_USER ${bazarrVenv}/bin/pip install -r ${bazarrDir}/requirements.txt
|
|
|
|
addConf -s "$lService" "$bazarrServiceLoc"
|
|
exe systemctl daemon-reload
|
|
}
|
|
bazarrService="[Unit]
|
|
Description=Bazarr
|
|
After=syslog.target network.target
|
|
Wants=sonarr.service radarr.service
|
|
StartLimitIntervalSec=0
|
|
|
|
[Service]
|
|
User=\$DLD_USER
|
|
Group=\$DLD_USER
|
|
|
|
Type=simple
|
|
|
|
ExecStart=\${DLD_DIR}/bazarr/bin/python3 \${DLD_DIR}/bazarr/bazarr/bazarr.py
|
|
TimeoutStopSec=20
|
|
#KillMode=process
|
|
Restart=always
|
|
RestartSec=5
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|
|
Alias=bazarr.service"
|
|
|
|
step_15_info() { echo "Create ufw rules for default ports"; }
|
|
step_15_alias() { ALIAS="ufw"; }
|
|
step_15() {
|
|
exe ufw allow in on eth0 to any port 6789 proto tcp comment "NZBGet"
|
|
exe ufw allow in on eth0 to any port 9117 proto tcp comment "Jackett. Rules for Sonarr und Radarr in /etc/ufw/rules.before"
|
|
|
|
outColor red
|
|
echo
|
|
echo "[W] Add the following lines before \"# drop INVALID packets\""
|
|
echo " [/etc/ufw/before.rules]"
|
|
echo
|
|
outColor green
|
|
echo "# Allow all packages to sonarr and radarr"
|
|
echo "# ufw thinks that nzb360 sends messages after socket is closed"
|
|
echo "-A ufw-before-input -i eth0 -p tcp --dport 7878 -j ACCEPT"
|
|
echo "-A ufw-before-input -i eth0 -p tcp --dport 8989 -j ACCEPT"
|
|
echo "-A ufw-before-output -o eth0 -p tcp --sport 7878 -j ACCEPT"
|
|
echo "-A ufw-before-output -o eth0 -p tcp --sport 8989 -j ACCEPT"
|
|
echo
|
|
}
|
|
|
|
step_16_info() {
|
|
echo "Build and install unrar-nonfree"
|
|
echoinfo "Please provide a deb-src sources entry first"
|
|
echoinfo "[/etc/apt/sources.list]"
|
|
}
|
|
step_16() {
|
|
local buildPath="/tmp/unrarbuild"
|
|
|
|
cat /etc/apt/sources.list | grep -E "^deb-src" >>/dev/null 2>&1
|
|
endReturn -o $? "No deb-src entry found in /etc/apt/sources.list"
|
|
|
|
exe mkdir -p "$buildPath"
|
|
exe cd "$buildPath"
|
|
exe apt build-dep unrar-nonfree $APTOPT
|
|
exe apt source -b unrar-nonfree $APTOPT
|
|
endReturn -o $? "unrar-nonfree build failed ($buildPath left untouched)"
|
|
exe dpkg -i unrar*.deb
|
|
endReturn -o $? "unrar-nonfree install failed ($buildPath left untouched)"
|
|
|
|
exe rm -rf "$buildPath"
|
|
}
|
|
|
|
step_17_info() { echo "Install danted socks proxy"; }
|
|
step_17_alias() { ALIAS="danted"; }
|
|
step_17() {
|
|
systemctl status danted.service >>/dev/null 2>&1
|
|
if [ $? -eq 0 ]; then
|
|
echoseq " [I] Danted already installed"
|
|
return 0
|
|
fi
|
|
exe apt update
|
|
exe apt install dante-server $APTOPT
|
|
exe systemctl stop danted.service
|
|
exe systemctl disable danted.service
|
|
}
|
|
|
|
step_18_info() { echo "Danted installation notes"; }
|
|
step_18() {
|
|
cat <<DANTED_EOF
|
|
[I] Debian fix systemd startup
|
|
systemctl edit --full danted.service
|
|
|
|
# Change /lib64 to -/lib64
|
|
ReadOnlyDirectories=/bin /etc /lib -/lib64 /sbin /usr /var
|
|
|
|
[I] Basic danted settings
|
|
* Restrict to local network
|
|
* Separate logfile
|
|
[/etc/danted.conf]
|
|
logoutput: stderr /var/log/dante.log
|
|
internal: eth0 port = 1080
|
|
external: tun0
|
|
socksmethod: none
|
|
clientmethod: none
|
|
client pass {
|
|
from: 192.168.0.0/24 port 1-65535 to: 0.0.0.0/0
|
|
log: error
|
|
}
|
|
client block {
|
|
from: 0.0.0.0/0 to: 0.0.0.0/0
|
|
log: error
|
|
}
|
|
socks block {
|
|
from: 0.0.0.0/0 to: 127.0.0.0/4
|
|
log: error
|
|
}
|
|
socks pass {
|
|
from: 192.168.23.0/24 to: 0.0.0.0/0
|
|
protocol: tcp udp
|
|
log: error
|
|
}
|
|
socks block {
|
|
from: 0.0.0.0/0 to: 0.0.0.0/0
|
|
log: connect error
|
|
}
|
|
|
|
DANTED_EOF
|
|
}
|
|
|
|
step_19_info() { echo "Disable apt-daily activities"; }
|
|
step_19_alias() { ALIAS="aptdaily"; }
|
|
step_19() {
|
|
exe /usr/bin/systemctl stop apt-daily-upgrade.timer
|
|
exe /usr/bin/systemctl stop apt-daily.timer
|
|
exe /usr/bin/systemctl disable apt-daily-upgrade.timer
|
|
exe /usr/bin/systemctl disable apt-daily.timer
|
|
exe /usr/bin/systemctl mask apt-daily.service
|
|
exe /usr/bin/systemctl daemon-reload
|
|
}
|
|
|
|
step_21_info() {
|
|
local pInstallDir="${DLD_DIR}/prowlarr"
|
|
case $CONTEXT_HELP in
|
|
0)
|
|
if [ -e "$pInstallDir" ]; then
|
|
echo -n "Upgrade "
|
|
else
|
|
echo -n "Install "
|
|
fi
|
|
;;
|
|
*)
|
|
echo -n "Install/Update ";;
|
|
esac
|
|
echo "prowlarr for arm64"
|
|
echoinfo "Default port: 9696"
|
|
}
|
|
step_21_alias() { ALIAS="prowlarr"; }
|
|
step_21() {
|
|
# local pDownDir="/tmp"
|
|
local pInstallDir="${DLD_DIR}/prowlarr"
|
|
local pUrl="http://prowlarr.servarr.com/v1/update/develop/updatefile?os=linux&runtime=netcore&arch=arm64"
|
|
|
|
[ ! -e "$pTar" ] && exe wget --content-disposition "$pUrl" -O "$pTar"
|
|
|
|
if [ -e "$pInstallDir" ]; then
|
|
prowlarrUpgrade=1
|
|
echoseq " [I] Stopping prowlarr service"
|
|
echoseq " Service will not be started automatically after update"
|
|
exe service prowlarr stop
|
|
echoseq " [I] Moving existing $pInstallDir as backup"
|
|
exe mv "$pInstallDir" "${pInstallDir}_bu_"`date +%Y%m%d-%H%M%S`
|
|
fi
|
|
|
|
exe tar xvzf "$pTar" -C "${DLD_DIR}"
|
|
exe mv "${DLD_DIR}/Prowlarr" "${DLD_DIR}/prowlarr"
|
|
exe chown -R ${DLD_USER}:${DLD_USER} "${DLD_DIR}/prowlarr"
|
|
}
|
|
pTar="/tmp/Prowlarr.tgz"
|
|
prowlarrUpgrade=0
|
|
|
|
step_22_info() { echo "Clean prowlarr download"; }
|
|
step_22_alias() { ALIAS="prowlarrclean"; }
|
|
step_22() {
|
|
exe rm -rf "$pTar"
|
|
if [ $prowlarrUpgrade -ne 0 ]; then
|
|
echoseq " [I] Stopping sequence here."
|
|
echoseq " Following steps only exected for fresh installation."
|
|
exit 0
|
|
fi
|
|
}
|
|
|
|
step_23_info() { echo "Create prowlarr service"; }
|
|
step_23() {
|
|
local prowlarrServiceLoc="/etc/systemd/system/prowlarr.service"
|
|
local lService=`eval "echo \"$prowlarrService\""`
|
|
addConf -s "$lService" "$prowlarrServiceLoc"
|
|
exe systemctl daemon-reload
|
|
}
|
|
prowlarrService="[Unit]
|
|
Description=Prowlarr Daemon
|
|
After=syslog.target network.target
|
|
|
|
[Service]
|
|
User=\$DLD_USER
|
|
Group=\$DLD_USER
|
|
Type=simple
|
|
SyslogIdentifier=prowlarr
|
|
Restart=on-failure
|
|
RestartSec=5
|
|
WorkingDirectory=\${DLD_DIR}/prowlarr
|
|
ExecStart=/bin/sh \${DLD_DIR}/prowlarr/Prowlarr -nobrowser -data=\${DLD_CONFDIR}/prowlarr
|
|
TimeoutStopSec=30
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|
|
Alias=prowlarr.service"
|
|
|
|
step_24_info() { echo "Create ufw rule for prowlarr"; }
|
|
step_24() {
|
|
exe ufw allow in on eth0 to any port 9696 proto tcp comment "Prowlarr"
|
|
}
|
|
|
|
step_30_info() {
|
|
local pInstallDir="${DLD_DIR}/readarr"
|
|
case $CONTEXT_HELP in
|
|
0)
|
|
if [ -e "$pInstallDir" ]; then
|
|
echo -n "Upgrade "
|
|
else
|
|
echo -n "Install "
|
|
fi
|
|
;;
|
|
*)
|
|
echo -n "Install/Update ";;
|
|
esac
|
|
echo "readarr for arm64"
|
|
echoinfo "Default port: 8787"
|
|
}
|
|
step_30_alias() { ALIAS="readarr"; }
|
|
step_30() {
|
|
# local pDownDir="/tmp"
|
|
local lInstallDir="${DLD_DIR}/readarr"
|
|
local lUrl="http://readarr.servarr.com/v1/update/nightly/updatefile?os=linux&runtime=netcore&arch=arm64"
|
|
|
|
[ ! -e "$readarrTar" ] && exe wget --content-disposition "$lUrl" -O "$readarrTar"
|
|
|
|
if [ -e "$lInstallDir" ]; then
|
|
readarrUpgrade=1
|
|
echoseq " [I] Stopping readarr service"
|
|
echoseq " Service will not be started automatically after update"
|
|
exe service readarr stop
|
|
echoseq " [I] Moving existing $lInstallDir as backup"
|
|
exe mv "$lInstallDir" "${lInstallDir}_bu_"`date +%Y%m%d-%H%M%S`
|
|
fi
|
|
|
|
exe tar xvf "$readarrTar" -C "${DLD_DIR}"
|
|
exe mv "${DLD_DIR}/Readarr" "${lInstallDir}"
|
|
exe chown -R ${DLD_USER}:${DLD_USER} "${lInstallDir}"
|
|
}
|
|
readarrTar="/tmp/Readarr.tar.gz"
|
|
readarrUpgrade=0
|
|
|
|
step_31_info() { echo "Clean readarr download"; }
|
|
step_31_alias() { ALIAS="readarrclean"; }
|
|
step_31() {
|
|
exe rm -rf "$readarrTar"
|
|
if [ $readarrUpgrade -ne 0 ]; then
|
|
echoseq " [I] Stopping sequence here."
|
|
echoseq " Following steps only exected for fresh installation."
|
|
exit 0
|
|
fi
|
|
}
|
|
|
|
step_32_info() { echo "Create readarr service"; }
|
|
step_32() {
|
|
local readarrServiceLoc="/etc/systemd/system/readarr.service"
|
|
local lService=`eval "echo \"$readarrService\""`
|
|
addConf -s "$lService" "$readarrServiceLoc"
|
|
exe systemctl daemon-reload
|
|
}
|
|
readarrService="[Unit]
|
|
Description=Readarr Daemon
|
|
After=syslog.target network.target
|
|
|
|
[Service]
|
|
User=\$DLD_USER
|
|
Group=\$DLD_USER
|
|
Type=simple
|
|
SyslogIdentifier=readarr
|
|
RestartSec=5
|
|
WorkingDirectory=\${DLD_DIR}/readarr
|
|
ExecStart=\${DLD_DIR}/readarr/Readarr -nobrowser -data=\${DLD_CONFDIR}/readarr
|
|
TimeoutStopSec=20
|
|
KillMode=process
|
|
Restart=on-failure
|
|
|
|
[Install]
|
|
WantedBy=multi-user.target
|
|
Alias=readarr.service"
|
|
|
|
step_33_info() { echo "Create ufw rule for readarr"; }
|
|
step_33() {
|
|
exe ufw allow in on eth0 to any port 8787 proto tcp comment "Readarr"
|
|
}
|
|
|
|
step_50_info() { echo "Upgrade bazarr"; }
|
|
step_50_alias() { ALIAS="upgradebazarr"; }
|
|
step_50() {
|
|
local bazarrServiceLoc="/etc/systemd/system/bazarr.service"
|
|
local lService=`eval "echo \"$bazarrService\""`
|
|
local bazarrVenv="${DLD_DIR}/bazarr"
|
|
local bazarrDir="${bazarrVenv}/bazarr"
|
|
|
|
local bazarrGitUrl="https://github.com/morpheus65535/bazarr.git"
|
|
|
|
exe sudo -u $DLD_USER ${bazarrVenv}/bin/pip install --upgrade pip
|
|
exe sudo -u $DLD_USER ${bazarrVenv}/bin/pip install -r ${bazarrDir}/requirements.txt
|
|
}
|
|
|
|
checkVpn() {
|
|
ip -br a | grep tun >>/dev/null 2>&1
|
|
[ $? -eq 0 ] && echoseq " [W] A VPN connection is possibly active. Consider deactivating it befor any apt operation."
|
|
}
|
|
|
|
VERSION_SEQREV=13
|
|
. /usr/local/bin/sequencer.sh
|