1
0
mirror of https://github.com/gilbN/theme.park.git synced 2024-07-15 00:57:32 +02:00

vuetorrent mod TP_DISABLE_THEME env and qBittorrent.conf backup

This commit is contained in:
Marius 2021-08-02 23:48:03 +02:00
parent 1c2906dc83
commit 503685e926

View File

@ -6,6 +6,20 @@ if [ "${TP_HOTIO}" = true ]; then
APP_FILEPATH='/config/config/qBittorrent.conf'
INDEX_FILEPATH='/app/vuetorrent/public/index.html'
fi
# Backup config
if [[ ! -f "${APP_FILEPATH}.bak" ]]; then
echo "Creating qBittorrent.conf backup in /config."
cp -p ${APP_FILEPATH} "${APP_FILEPATH}.bak"
fi
# Restore qBittorrent.conf
if [ "${TP_DISABLE_THEME}" = true ]; then
echo "Restoring backup of qBittorrent.conf"
sed -i "s/WebUI\\\AlternativeUIEnabled=.*$/WebUI\\\AlternativeUIEnabled=false/g" "${APP_FILEPATH}";
exit 0
fi
# Display variables for troubleshooting
echo -e "Variables set:\\n\
'TP_DOMAIN'=${TP_DOMAIN}\\n\
@ -113,6 +127,7 @@ if ! grep -q "${TP_DOMAIN}" "${INDEX_FILEPATH}"; then
echo '---------------------------------------------------------'
echo '| Adding the stylesheet to /vuetorrent/public/index.html |'
echo '---------------------------------------------------------'
sed -i "s/<\/body>/<link rel='stylesheet' href='https:\/\/${TP_DOMAIN}\/CSS\/themes\/vuetorrent\/${TP_THEME}.css'><\/body> /g" "${INDEX_FILEPATH}"
sed -i "s/<\/body>/<link rel='stylesheet' href='https:\/\/${TP_DOMAIN}\/CSS\/themes\/vuetorrent\/vuetorrent-base.css'><\/body> /g" "${INDEX_FILEPATH}"
sed -i "s/<\/body>/<link rel='stylesheet' href='https:\/\/${TP_DOMAIN}\/CSS\/variables\/${TP_THEME}.css'><\/body> /g" "${INDEX_FILEPATH}"
printf 'Stylesheet set to %s on public index.html\n' "${TP_THEME}"
fi