#!/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" IFS='"' set $(cat /etc/unraid-version) UNRAID_VERSION="$2" IFS=$' \t\n' LOGIN_PAGE="/usr/local/emhttp/login.php" # Changing file path to login.php if version >= 6.10 if [[ "${UNRAID_VERSION}" =~ ^6.10.* ]]; then echo "Unraid version: ${UNRAID_VERSION}, changing path to login page" LOGIN_PAGE="/usr/local/emhttp/webGui/include/.login.php" fi # Restore login.php if [ ${DISABLE_THEME} = "true" ]; then echo "Restoring backup of login.php" cp -p ${LOGIN_PAGE}.backup ${LOGIN_PAGE} exit 0 fi # Backup login page if needed. if [ ! -f ${LOGIN_PAGE}.backup ]; then echo "Creating backup of login.php" cp -p ${LOGIN_PAGE} ${LOGIN_PAGE}.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} ${LOGIN_PAGE}; then echo "Adding stylesheet" sed -i -e "\@