Browse Source

Bash syntax fixes, thanks Tronyx :)

pull/149/head
gilbN 5 years ago
parent
commit
c01584b5e0
  1. 21
      sonarr/root/etc/cont-init.d/98-themepark-sonarr

21
sonarr/root/etc/cont-init.d/98-themepark-sonarr

@ -1,7 +1,7 @@
#!/usr/bin/with-contenv bash #!/usr/bin/with-contenv bash
echo '---------------------------' echo '---------------------------'
echo '|__Sonarr theme.park Mod__|' echo '| Sonarr theme.park Mod |'
echo '---------------------------' echo '---------------------------'
# Display variables for troubleshooting # Display variables for troubleshooting
@ -10,20 +10,21 @@ echo -e "Variables set:\\n\
'TP_THEME'=${TP_THEME}\\n" 'TP_THEME'=${TP_THEME}\\n"
# Set default # Set default
if [ ! -n "${TP_DOMAIN}" ]; then if [[ -z ${TP_DOMAIN} ]]; then
echo "Setting TP_DOMAIN to default (gilbn.github.io)" echo 'No domain set, defaulting to gilbn.github.io'
TP_DOMAIN="gilbn.github.io" TP_DOMAIN='gilbn.github.io'
fi fi
if [ ! -n "${TP_THEME}" ]; then
echo "No theme set, defaulting to organizr-dark" if [[ -z ${TP_THEME} ]]; then
TP_THEME="organizr-dark" echo 'No theme set, defaulting to organizr-dark'
TP_THEME='organizr-dark'
fi fi
# Adding stylesheets # Adding stylesheets
if ! grep -q ${TP_DOMAIN} /app/sonarr/bin/UI/index.html; then if ! grep -q "${TP_DOMAIN}" /app/sonarr/bin/UI/index.html; then
echo '---------------------------' echo '---------------------------'
echo '|__Adding the stylesheet__|' echo '| Adding the stylesheet |'
echo '---------------------------' echo '---------------------------'
sed -i "s/<\/head>/<link rel='stylesheet' href='https:\/\/${TP_DOMAIN}\/theme.park\/CSS\/themes\/sonarr\/${TP_THEME}.css'><\/head> /g" /app/sonarr/bin/UI/index.html sed -i "s/<\/head>/<link rel='stylesheet' href='https:\/\/${TP_DOMAIN}\/theme.park\/CSS\/themes\/sonarr\/${TP_THEME}.css'><\/head> /g" /app/sonarr/bin/UI/index.html
echo "Stylesheet set to ${TP_THEME}\\n" printf 'Stylesheet set to %s\n' "${TP_THEME}"
fi fi
Loading…
Cancel
Save