Browse Source

vuetorrent hotio support

pull/240/head
gilbN 4 years ago
parent
commit
3d3047bafc
  1. 44
      vuetorrent/root/etc/cont-init.d/98-themepark

44
vuetorrent/root/etc/cont-init.d/98-themepark

@ -1,8 +1,10 @@
#!/usr/bin/with-contenv bash #!/usr/bin/with-contenv bash
APP_FILEPATH='/config/qBittorrent/qBittorrent.conf' APP_FILEPATH='/config/qBittorrent/qBittorrent.conf'
INDEX_FILEPATH='/vuetorrent/public/index.html'
if [ "${TP_HOTIO}" = true ]; then if [ "${TP_HOTIO}" = true ]; then
echo 'Changing to Hotio file path!' echo 'Changing to Hotio file paths!'
APP_FILEPATH='/config/config/qBittorrent.conf' APP_FILEPATH='/config/config/qBittorrent.conf'
INDEX_FILEPATH='/app/vuetorrent/public/index.html'
fi fi
# Display variables for troubleshooting # Display variables for troubleshooting
echo -e "Variables set:\\n\ echo -e "Variables set:\\n\
@ -70,45 +72,47 @@ echo '-----------------------------------------'
echo '| qBittorrent vuetorrent theme.park Mod |' echo '| qBittorrent vuetorrent theme.park Mod |'
echo '-----------------------------------------' echo '-----------------------------------------'
install_deps if [[ -z ${TP_HOTIO} ]]; then
check_updates install_deps
check_updates
if [ "$NEEDS_UPDATE" = true ]; then if [ "$NEEDS_UPDATE" = true ]; then
echo '---------------------------------------' echo '---------------------------------------'
echo '| Downloading WebUI files from github |' echo '| Downloading WebUI files from github |'
echo '---------------------------------------' echo '---------------------------------------'
update_ui update_ui
else else
echo ' WebUI files are up-to-date!' echo ' WebUI files are up-to-date!'
fi fi
# Adding stylesheets
if ! grep -q "${TP_DOMAIN}" /vuetorrent/public/index.html; 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" /vuetorrent/public/index.html
printf 'Stylesheet set to %s on public index.html\n' "${TP_THEME}"
fi
if ! grep -q "WebUI\\\RootFolder" "${APP_FILEPATH}"; then if ! grep -q "WebUI\\\RootFolder" "${APP_FILEPATH}"; then
echo '--------------------------------------' echo '--------------------------------------'
echo '| Adding WebUI\RootFolder=/vuetorrent |' echo '| Adding WebUI\RootFolder=/vuetorrent |'
echo '--------------------------------------' echo '--------------------------------------'
sed -i -e '$aWebUI\\RootFolder=/vuetorrent' "${APP_FILEPATH}" sed -i -e '$aWebUI\\RootFolder=/vuetorrent' "${APP_FILEPATH}"
fi fi
if ! grep -q "WebUI\\\AlternativeUIEnabled" "${APP_FILEPATH}"; then if ! grep -q "WebUI\\\AlternativeUIEnabled" "${APP_FILEPATH}"; then
echo '------------------------------------------' echo '------------------------------------------'
echo '| Adding WebUI\AlternativeUIEnabled=true |' echo '| Adding WebUI\AlternativeUIEnabled=true |'
echo '------------------------------------------' echo '------------------------------------------'
sed -i -e '$aWebUI\\AlternativeUIEnabled=true' "${APP_FILEPATH}" sed -i -e '$aWebUI\\AlternativeUIEnabled=true' "${APP_FILEPATH}"
fi fi
if ! grep -q "WebUI\\\RootFolder=/vuetorrent" "${APP_FILEPATH}" || ! grep -q "WebUI\\\AlternativeUIEnabled=true" "${APP_FILEPATH}"; then if ! grep -q "WebUI\\\RootFolder=/vuetorrent" "${APP_FILEPATH}" || ! grep -q "WebUI\\\AlternativeUIEnabled=true" "${APP_FILEPATH}"; then
echo '-------------------------------------------------------' echo '-------------------------------------------------------'
echo '| Updating RootFolder and AlternativeUIEnabled values |' echo '| Updating RootFolder and AlternativeUIEnabled values |'
echo '-------------------------------------------------------' echo '-------------------------------------------------------'
sed -i "s/WebUI\\\AlternativeUIEnabled=.*$/WebUI\\\AlternativeUIEnabled=true/g" "${APP_FILEPATH}" sed -i "s/WebUI\\\AlternativeUIEnabled=.*$/WebUI\\\AlternativeUIEnabled=true/g" "${APP_FILEPATH}"
sed -i "s/WebUI\\\RootFolder=.*$/WebUI\\\RootFolder=\/vuetorrent/g" "${APP_FILEPATH}" sed -i "s/WebUI\\\RootFolder=.*$/WebUI\\\RootFolder=\/vuetorrent/g" "${APP_FILEPATH}"
fi
fi
# Adding stylesheets
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}"
printf 'Stylesheet set to %s on public index.html\n' "${TP_THEME}"
fi fi
Loading…
Cancel
Save