#!/bin/bash TYPE="retro-terminal" THEME="green.css" DOMAIN="theme-park.dev" #if you update the domain after the script has been run, You must disable and re enable JS or the whole theme. ADD_JS="true" JS="custom_text_header.js" DISABLE_THEME="false" echo -e "Variables set:\\n\ THEME = ${THEME}\\n\ DOMAIN = ${DOMAIN}\\n\ ADD_JS = ${ADD_JS}\\n\ JS = ${JS}\\n\ DISABLE_THEME = ${DISABLE_THEME}\\n" # Restore login.php if [ ${DISABLE_THEME} = "true" ]; then echo "Restoring backup of login.php" cp -p /usr/local/emhttp/login.php.backup /usr/local/emhttp/login.php exit 0 fi # Backup login page if needed. if [ ! -f /usr/local/emhttp/login.php.backup ]; then echo "Creating backup of login.php" cp -p /usr/local/emhttp/login.php /usr/local/emhttp/login.php.backup fi # Use correct domain style case ${DOMAIN} in *"github.io"*) echo "Switching to github.io URL style" DOMAIN="${DOMAIN}\/theme.park" ;; esac # Adding stylesheets if ! grep -q ${DOMAIN} /usr/local/emhttp/login.php; then echo "Adding stylesheet" sed -i -e "\@