mirror of
https://github.com/gilbN/theme.park.git
synced 2024-08-17 23:49:37 +02:00
vuetorrent mod TP_DISABLE_THEME env and qBittorrent.conf backup
This commit is contained in:
parent
1c2906dc83
commit
503685e926
@ -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
|
Loading…
Reference in New Issue
Block a user