Updated workflow for modifying sabnzbd configuration

pull/6/head
RandomNinjaAtk 5 years ago committed by GitHub
parent 43b32e5d2e
commit f87507b818
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -42,10 +42,17 @@ if [ ! -f "/config/sabnzbd.ini" ]; then
exit 0
fi
if cat "/config/sabnzbd.ini" | grep "\[categories\]" | read; then
# Check if config is already updated, if not start cron...
if cat "/config/sabnzbd.ini" | grep "/config/scripts" | read; then
sleep 0.1
echo "config already updated..."
exit 0
else
# start cron
service cron start
fi
# Check for finished initial config file, if sab is done, proceed with automated modifications...
if cat "/config/sabnzbd.ini" | grep "\[categories\]" | read; then
# Add scripts path
if cat "/config/sabnzbd.ini" | grep "script_dir = \"\"" | read; then
sed -i "s/script_dir = \"\"/script_dir = \"\/config\/scripts\"/g" "/config/sabnzbd.ini"
@ -85,13 +92,12 @@ if cat "/config/sabnzbd.ini" | grep "\[categories\]" | read; then
# Add categories
sed -i '/\[categories\]/a\\[\[radarr\]\]\npriority = -100\npp = ""\nname = radarr\nscript = radarr-pp.bash\nnewzbin = ""\norder = 1\n\dir = radarr\n\[\[sonarr\]\]\npriority = -100\npp = ""\nname = sonarr\nscript = sonarr-pp.bash\nnewzbin = ""\norder = 2\n\dir = sonarr\n\[\[lidarr\]\]\npriority = -100\npp = ""\nname = lidarr\nscript = audio-pp.bash\nnewzbin = ""\norder = 3\n\dir = lidarr' "/config/sabnzbd.ini"
sleep 5
sleep 2
restartsab=$(pgrep s6-supervise | sort -r | head -n1) && \
kill ${restartsab} && \
echo "config updated" && \
# stop cron
service cron stop
fi
fi
exit 0

Loading…
Cancel
Save