parent
c9185eebb4
commit
fac85736f7
@ -1,53 +1,37 @@
|
|||||||
#!/usr/bin/with-contenv bash
|
#!/usr/bin/with-contenv bash
|
||||||
|
|
||||||
# import new config, if does not exist
|
# Remove exisitng
|
||||||
if [ ! -f "/config/scripts/configs/sonarr-pp.ini" ]; then
|
if [ -d "/config/scripts/sma" ]; then
|
||||||
cp "/usr/local/sma/setup/autoProcess.ini.sample" "/config/scripts/configs/sonarr-pp.ini" && \
|
rm -rf "/config/scripts/sma" && \
|
||||||
# set permissions
|
|
||||||
chmod 0666 "/config/scripts/configs/sonarr-pp.ini"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# import new config, if does not exist
|
|
||||||
if [ ! -f "/config/scripts/configs/radarr-pp.ini" ]; then
|
|
||||||
cp "/usr/local/sma/setup/autoProcess.ini.sample" "/config/scripts/configs/radarr-pp.ini" && \
|
|
||||||
# set permissions
|
|
||||||
chmod 0666 "/config/scripts/configs/radarr-pp.ini"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Remove sonarr log
|
|
||||||
if [ -f "/config/scripts/logs/sonarr-pp.log" ]; then
|
|
||||||
rm "/config/scripts/logs/sonarr-pp.log" && \
|
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Remove radarr log
|
if [ -d "/usr/local/sma/config" ]; then
|
||||||
if [ -f "/config/scripts/logs/radarr-pp.log" ]; then
|
rm -rf /usr/local/sma/config/* && \
|
||||||
rm "/config/scripts/logs/radarr-pp.log" && \
|
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# create sonarr log
|
# create config directory
|
||||||
if [ ! -f "/config/scripts/logs/sonarr-pp.log" ]; then
|
if [ ! -d "/config/scripts/sma" ]; then
|
||||||
touch "/config/scripts/logs/sonarr-pp.log" && \
|
mkdir -p "/config/scripts/sma" && \
|
||||||
# set permissions
|
chmod 0777 -R "/config/scripts/sma"
|
||||||
chmod 0666 "/config/scripts/logs/sonarr-pp.log"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# create radarr log
|
|
||||||
if [ ! -f "/config/scripts/logs/radarr-pp.log" ]; then
|
# import new config, if does not exist
|
||||||
touch "/config/scripts/logs/radarr-pp.log" && \
|
if [ ! -f "/config/sma/autoProcess.ini" ]; then
|
||||||
# set permissions
|
cp "/usr/local/sma/setup/autoProcess.ini.sample" "/usr/local/sma/config/autoProcess.ini"
|
||||||
chmod 0666 "/config/scripts/logs/radarr-pp.log"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Set ffmpeg/ffprobe location
|
# create sma log file
|
||||||
sed -i "s/ffmpeg.exe/ffmpeg/g" "/config/scripts/configs/sonarr-pp.ini"
|
touch "/config/scripts/sma/sma.log" && \
|
||||||
sed -i "s/ffprobe.exe/ffprobe/g" "/config/scripts/configs/sonarr-pp.ini"
|
|
||||||
|
|
||||||
# Set ffmpeg/ffprobe location
|
# link sma log file
|
||||||
sed -i "s/ffmpeg.exe/ffmpeg/g" "/config/scripts/configs/radarr-pp.ini"
|
ln -s "/config/scripts/sma/sma.log" "/usr/local/sma/config/sma.log" && \
|
||||||
sed -i "s/ffprobe.exe/ffprobe/g" "/config/scripts/configs/radarr-pp.ini"
|
|
||||||
|
|
||||||
|
# set permissions
|
||||||
|
chmod 0666 "/config/scripts/sma"/*
|
||||||
chmod 0777 -R "/usr/local/sma"
|
chmod 0777 -R "/usr/local/sma"
|
||||||
|
chmod 0777 -R "/scripts"
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
Loading…
Reference in new issue