Adding steps for install/upgrade readarr
This commit is contained in:
@@ -453,10 +453,11 @@ step_21() {
|
||||
[ ! -e "$pTar" ] && exe wget --content-disposition "$pUrl" -O "$pTar"
|
||||
|
||||
if [ -e "$pInstallDir" ]; then
|
||||
echo " [I] Stopping prowlarr service"
|
||||
echo " Service will not be started automatically after update"
|
||||
prowlarrUpgrade=1
|
||||
echoseq " [I] Stopping prowlarr service"
|
||||
echoseq " Service will not be started automatically after update"
|
||||
exe service prowlarr stop
|
||||
echo " [I] Moving existing $pInstallDir as backup"
|
||||
echoseq " [I] Moving existing $pInstallDir as backup"
|
||||
exe mv "$pInstallDir" "${pInstallDir}_bu_"`date +%Y%m%d-%H%M%S`
|
||||
fi
|
||||
|
||||
@@ -465,11 +466,17 @@ step_21() {
|
||||
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"; }
|
||||
@@ -503,6 +510,89 @@ 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=/bin/sh -c \"\${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() {
|
||||
|
Reference in New Issue
Block a user