lidarr-dl/sabnzbd/setup.bash

61 lines
2.1 KiB
Bash
Raw Normal View History

2023-07-07 18:07:40 +02:00
#!/usr/bin/with-contenv bash
2023-07-07 20:24:11 +02:00
scriptVersion="1.4"
2023-07-07 18:07:40 +02:00
######## Package dependencies installation
InstallRequirements () {
echo "Installing Required Packages..."
2023-07-07 18:26:01 +02:00
apk add -U --update --no-cache curl jq python3-dev py3-pip git ffmpeg
pip install --upgrade --no-cache-dir -U yq
2023-07-07 18:07:40 +02:00
echo "Done"
2023-07-07 18:26:01 +02:00
if [ -d /config/scripts/sma ]; then
rm -rf /config/scripts/sma
2023-07-07 18:07:40 +02:00
fi
2023-07-07 18:26:01 +02:00
echo "************ setup SMA ************"
echo "************ setup directory ************"
mkdir -p /config/scripts/sma
echo "************ download repo ************"
git clone https://github.com/mdhiggins/sickbeard_mp4_automator.git /config/scripts/sma
mkdir -p /config/scripts/sma/config
echo "************ create logging file ************"
mkdir -p /config/scripts/sma/config
touch /config/scripts/sma/config/sma.log
echo "************ install pip dependencies ************"
pip install --upgrade pip --no-cache-dir
pip install -r /config/scripts/sma/setup/requirements.txt --no-cache-dir
chmod 777 -R /config/scripts/sma
2023-07-07 18:07:40 +02:00
}
2023-07-07 18:29:00 +02:00
echo "Setup Script Version: $scriptVersion"
2023-07-07 18:07:40 +02:00
InstallRequirements
2023-07-07 18:18:53 +02:00
mkdir -p /config/scripts
chmod 777 /config/scripts
2023-07-07 18:26:01 +02:00
echo "Downloading SMA config: /config/scripts/sma.ini"
2023-07-07 20:19:42 +02:00
curl "https://raw.githubusercontent.com/RandomNinjaAtk/arr-scripts/main/sabnzbd/sma.ini" -o /config/sma.ini
2023-07-07 20:13:14 +02:00
if [ -f /config/sma.ini ]; then
if [ -f /config/scripts/sma.ini ]; then
echo "Removing /config/scripts/sma.ini"
rm /config/scripts/sma.ini
fi
echo "Importing /config/sma.ini to /config/scripts/sma.ini"
2023-07-07 20:24:11 +02:00
mv /config/sma.ini /config/scripts/sma.ini
2023-07-07 20:13:14 +02:00
chmod 777 /config/scripts/sma.ini
fi
2023-07-07 18:26:01 +02:00
echo "Downloading Video script config: /config/scripts/video.bash"
2023-07-07 20:19:42 +02:00
curl "https://raw.githubusercontent.com/RandomNinjaAtk/arr-scripts/main/sabnzbd/video.bash" -o /config/video.bash
2023-07-07 20:13:14 +02:00
if [ -f /config/video.bash ]; then
if [ -f /config/scripts/video.bash ]; then
echo "Removing /config/scripts/video.bash"
rm /config/scripts/video.bash
fi
echo "Importing /config/sma.ini to /config/scripts/video.bash"
mv /config/video.bash /config/scripts/video.bash
chmod 777 /config/scripts/video.bash
fi
2023-07-07 18:18:53 +02:00
chmod 777 -R /config/scripts
2023-07-07 18:07:40 +02:00
exit