2023-07-07 18:07:40 +02:00
|
|
|
#!/usr/bin/with-contenv bash
|
2024-04-23 16:07:42 +02:00
|
|
|
scriptVersion="1.8"
|
2023-07-07 18:07:40 +02:00
|
|
|
|
|
|
|
######## Package dependencies installation
|
|
|
|
InstallRequirements () {
|
|
|
|
echo "Installing Required Packages..."
|
2023-07-07 20:55:30 +02:00
|
|
|
echo "************ install and update packages ************"
|
|
|
|
apk add -U --update --no-cache \
|
|
|
|
flac \
|
|
|
|
opus-tools \
|
|
|
|
jq \
|
|
|
|
git \
|
|
|
|
ffmpeg
|
|
|
|
apk add mp3val --repository=https://dl-cdn.alpinelinux.org/alpine/edge/testing
|
|
|
|
echo "*** install beets ***"
|
|
|
|
apk add --no-cache -X http://dl-cdn.alpinelinux.org/alpine/edge/community beets
|
|
|
|
echo "************ install python packages ************"
|
2024-03-27 21:42:25 +01:00
|
|
|
pip install --upgrade --no-cache-dir --break-system-packages -U \
|
2023-07-07 20:55:30 +02:00
|
|
|
m4b-merge \
|
|
|
|
pyacoustid \
|
|
|
|
requests \
|
|
|
|
pylast \
|
|
|
|
mutagen \
|
|
|
|
r128gain
|
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 ************"
|
2024-06-26 14:29:58 +02:00
|
|
|
if [ -d "${SMA_PATH}" ]; then
|
|
|
|
rm -rf "${SMA_PATH}"
|
|
|
|
fi
|
|
|
|
echo "*********SMA WORKAROUND ************"
|
|
|
|
pip3 install --break-system-packages \
|
|
|
|
requests \
|
|
|
|
idna \
|
|
|
|
requests-cache \
|
|
|
|
babelfish \
|
|
|
|
tmdbsimple \
|
|
|
|
mutagen \
|
|
|
|
guessit \
|
|
|
|
subliminal \
|
|
|
|
python-dateutil \
|
|
|
|
stevedore \
|
|
|
|
cleanit \
|
|
|
|
plexapi
|
2023-07-07 18:26:01 +02:00
|
|
|
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 ************"
|
2024-03-27 21:42:10 +01:00
|
|
|
pip install --upgrade pip --no-cache-dir --break-system-packages
|
|
|
|
pip install -r /config/scripts/sma/setup/requirements.txt --no-cache-dir --break-system-packages
|
2023-07-07 18:26:01 +02:00
|
|
|
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
|
2023-07-23 15:10:56 +02:00
|
|
|
if [ ! -f /config/scripts/sma.ini ]; then
|
|
|
|
echo "Importing /config/sma.ini to /config/scripts/sma.ini"
|
|
|
|
mv /config/sma.ini /config/scripts/sma.ini
|
|
|
|
chmod 777 /config/scripts/sma.ini
|
|
|
|
else
|
|
|
|
echo "File /config/scripts/sma.ini already exists. Not overwriting."
|
2023-07-07 20:13:14 +02:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2023-07-23 15:10:56 +02:00
|
|
|
|
2023-07-07 21:00:43 +02:00
|
|
|
echo "Downloading Video script: /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
|
2023-07-07 21:00:43 +02:00
|
|
|
echo "Importing /config/video.bash to /config/scripts/video.bash"
|
2023-07-07 20:13:14 +02:00
|
|
|
mv /config/video.bash /config/scripts/video.bash
|
|
|
|
chmod 777 /config/scripts/video.bash
|
2023-07-07 21:00:43 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Downloading Audio script: /config/scripts/audio.bash"
|
|
|
|
curl "https://raw.githubusercontent.com/RandomNinjaAtk/arr-scripts/main/sabnzbd/audio.bash" -o /config/audio.bash
|
|
|
|
if [ -f /config/audio.bash ]; then
|
|
|
|
if [ -f /config/scripts/audio.bash ]; then
|
|
|
|
echo "Removing /config/scripts/audio.bash"
|
2023-07-07 21:10:54 +02:00
|
|
|
rm /config/scripts/audio.bash
|
2023-07-07 21:00:43 +02:00
|
|
|
fi
|
|
|
|
echo "Importing /config/audio.bash to /config/scripts/audio.bash"
|
|
|
|
mv /config/audio.bash /config/scripts/audio.bash
|
|
|
|
chmod 777 /config/scripts/audio.bash
|
2023-07-07 21:16:32 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
echo "Downloading Audio script: /config/scripts/beets-config.yaml"
|
|
|
|
curl "https://raw.githubusercontent.com/RandomNinjaAtk/arr-scripts/main/sabnzbd/beets-config.yaml" -o /config/beets-config.yaml
|
|
|
|
if [ -f /config/beets-config.yaml ]; then
|
|
|
|
if [ -f /config/scripts/beets-config.yaml ]; then
|
|
|
|
echo "Removing /config/scripts/beets-config.yaml"
|
|
|
|
rm /config/scripts/beets-config.yaml
|
|
|
|
fi
|
|
|
|
echo "Importing /config/beets-config.yaml to /config/scripts/beets-config.yaml"
|
|
|
|
mv /config/beets-config.yaml /config/scripts/beets-config.yaml
|
|
|
|
chmod 777 /config/scripts/beets-config.yaml
|
2023-07-12 14:26:23 +02:00
|
|
|
fi
|
|
|
|
|
2023-07-19 13:23:30 +02:00
|
|
|
echo "Download audiobook script..."
|
|
|
|
curl https://raw.githubusercontent.com/RandomNinjaAtk/arr-scripts/main/sabnzbd/audiobook.bash -o /config/scripts/audiobook.bash
|
|
|
|
echo "Done"
|
|
|
|
|
2023-07-12 14:26:23 +02:00
|
|
|
if [ ! -f /config/extended.conf ]; then
|
|
|
|
echo "Download Extended config..."
|
|
|
|
curl https://raw.githubusercontent.com/RandomNinjaAtk/arr-scripts/main/sabnzbd/extended.conf -o /config/extended.conf
|
|
|
|
chmod 777 /config/extended.conf
|
|
|
|
echo "Done"
|
|
|
|
fi
|
2023-07-07 20:13:14 +02:00
|
|
|
|
2023-07-07 18:18:53 +02:00
|
|
|
chmod 777 -R /config/scripts
|
2024-04-23 16:07:42 +02:00
|
|
|
if [ -f /custom-services.d/scripts_init.bash ]; then
|
|
|
|
# user misconfiguration detected, sleeping...
|
|
|
|
sleep infinity
|
|
|
|
fi
|
|
|
|
|
2023-07-07 18:07:40 +02:00
|
|
|
exit
|