Files
docker-mods-uptime-kuma-tim…/root/etc/cont-init.d/98-flac2mp3
T
TheCaptain989 297b1a1013 Initial release
2020-12-07 11:15:44 -06:00

47 lines
1.1 KiB
Plaintext

#!/usr/bin/with-contenv bash
cat <<EOF
----------------
>>> Flac2MP3 Mod by TheCaptain989 <<<
Repo: https://github.com/linuxserver/docker-mods/tree/lidarr-flac2mp3
Version: $(cat /etc/version.tc989)
----------------
EOF
# Determine if setup is needed
if [ ! -f /usr/bin/ffmpeg ]; then
echo "Running first time setup."
if [ -f /usr/bin/apt ]; then
# Ubuntu
echo "Installing ffmpeg using apt-get"
apt-get update && \
apt-get -y install ffmpeg && \
rm -rf /var/lib/apt/lists/*
elif [ -f /sbin/apk ]; then
# Alpine
echo "Installing ffmpeg using apk"
apk add --no-cache ffmpeg && \
rm -rf /var/lib/apt/lists/*
else
# Unknown
echo "Unknown package manager. Attempting to install ffmpeg using apt-get"
apt-get update && \
apt-get -y install ffmpeg && \
rm -rf /var/lib/apt/lists/*
fi
fi
# Change ownership
if [ $(stat -c '%G' /usr/local/bin/flac2mp3.sh) != "abc" ]; then
echo "Changing ownership on scripts."
chown abc:abc /usr/local/bin/flac2mp3*.sh
fi
# Make executable
if [ ! -x /usr/local/bin/flac2mp3.sh ]; then
echo "Making scripts executable."
chmod +x /usr/local/bin/flac2mp3*.sh
fi