From fdb04c819a690b8b3f9b1e5d0110f52e7dd8b7dc Mon Sep 17 00:00:00 2001 From: RandomNinjaAtk Date: Tue, 26 May 2020 15:36:06 -0400 Subject: [PATCH] Update 32-sma-setup.bash --- root/etc/cont-init.d/32-sma-setup.bash | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/root/etc/cont-init.d/32-sma-setup.bash b/root/etc/cont-init.d/32-sma-setup.bash index fb7d0a2..823be2c 100644 --- a/root/etc/cont-init.d/32-sma-setup.bash +++ b/root/etc/cont-init.d/32-sma-setup.bash @@ -23,17 +23,21 @@ if [ ! -d "/config/scripts/configs" ]; then chmod 0777 -R "/config/scripts/configs" fi -# Update name of legacy file naming -if [ -f "/config/scripts/configs/autoProcess.ini" ]; then - mv "/config/scripts/configs/autoProcess.ini" "/config/scripts/configs/video-pp-sma.ini" +# import new config, if does not exist +if [ ! -f "/config/scripts/configs/radarr-sma.ini" ] || [ ! -f "/config/scripts/configs/sonarr-sma.ini" ]; then + if [ ! -f "/config/scripts/configs/video-pp-sma.ini" ]; then + cp "/usr/local/sma/setup/autoProcess.ini.sample" "/config/scripts/configs/video-pp-sma.ini" && \ + python3 /scripts/update.py + fi fi -# import new config, if does not exist -if [ ! -f "/config/scripts/configs/video-pp-sma.ini" ]; then - cp "/usr/local/sma/setup/autoProcess.ini.sample" "/config/scripts/configs/video-pp-sma.ini" && \ - python3 /scripts/update.py +if [ -f "/config/scripts/configs/video-pp-sma.ini" ]; then + cp "/config/scripts/configs/video-pp-sma.ini" "/config/scripts/configs/radarr-sma.ini" && \ + cp "/config/scripts/configs/video-pp-sma.ini" "/config/scripts/configs/sonarr-sma.ini" && \ + rm "/config/scripts/configs/video-pp-sma.ini" fi + # create sma log file touch "/config/scripts/logs/sma.log" && \