Jump to content

jawattus

Members
  • Posts

    5
  • Joined

  • Last visited

Posts posted by jawattus

  1. 20 minutes ago, GilbN said:

    Pretty sure your forked repo is out of date using the script.  You are 440 commits behind. 

    okay I will delete the fork and make a new fork and I will not change the name. And I will only change the domain to "DOMAIN = thijselblaso.github.io" in the script. What is the right format for the domain? "DOMAIN = thijselblaso.github.io" is this correct?

  2. 2 hours ago, GilbN said:

    or change this part to reflect your name change 

     

    # Use correct domain style
    case ${DOMAIN} in
      *"github.io"*)
      echo "Switching to github.io URL style"
        DOMAIN="${DOMAIN}\/theme.park"
        ;;
    esac

    Thanks for your help! I changed "DOMAIN="${DOMAIN}\/theme.park" to "DOMAIN="${DOMAIN}\/theme.park.edit"

     

    This is what I see when I run the script:

    Script location: /tmp/user.scripts/tmpScripts/Custom_unraid_loginscreen/script
    Note that closing this window will abort the execution of this script
    Variables set:
    THEME = white.css
    DOMAIN = thijselblaso.github.io
    ADD_JS = false
    JS = custom_text_header.js
    DISABLE_THEME = false
    
    Unraid version: 6.10.0-rc4, changing path to login page
    Switching to github.io URL style
    Adding stylesheet
    Stylesheet set to white.css

     

    but the login screen is not changed yet

  3. 13 minutes ago, GilbN said:

    When you run the script does it say "Switching to github.io URL style"?

     

    No it only say this when I start the script in the background:

    Script location: /tmp/user.scripts/tmpScripts/Custom_unraid_loginscreen/script
    Now starting the script in the background


    This is my script:

    #!/bin/bash
    TYPE="retro-terminal"
    THEME="white.css"
    DOMAIN="thijselblaso.github.io" # If you update the domain after the script has been run, You must disable and re enable JS or the whole theme.  
    ADD_JS="false"
    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 "\@<style>@i\    <link rel='stylesheet' href='https://${DOMAIN}/css/addons/unraid/login-page/${TYPE}/${THEME}'>" ${LOGIN_PAGE}
      echo 'Stylesheet set to' ${THEME}
    fi
    
    # Adding/Removing javascript
    if [ ${ADD_JS} = "true" ]; then
      if ! grep -q ${JS} ${LOGIN_PAGE}; then
        if grep -q "<script type='text/javascript' src='https://${DOMAIN}/css/addons/unraid/login-page/" ${LOGIN_PAGE}; then
          echo "Replacing Javascript"
          sed -i "/<script type='text\/javascript' src='https:\/\/${DOMAIN}\/css\/addons\/unraid\/login-page/c <script type='text/javascript' src='https://${DOMAIN}/css/addons/unraid/login-page/${TYPE}/js/${JS}'></script>" ${LOGIN_PAGE}
        else
          echo "Adding javascript"
          sed -i -e "\@</body>@i\    <script type='text/javascript' src='https://${DOMAIN}/css/addons/unraid/login-page/${TYPE}/js/${JS}'></script>" ${LOGIN_PAGE}
        fi
      fi
    else
      if grep -q ${JS} ${LOGIN_PAGE}; then
        echo "Removing javascript.."
        sed -i "/<script type='text\/javascript' src='https:\/\/${DOMAIN}\/css\/addons\/unraid\/login-page/d" ${LOGIN_PAGE}
      fi
    fi
    
    # Changing stylesheet
    if ! grep -q ${TYPE}"/"${THEME} ${LOGIN_PAGE}; then
      echo "Changing existing custom stylesheet.." 
      sed -i "/<link rel='stylesheet' href='https:\/\/${DOMAIN}\/css\/addons\/unraid\/login-page/c <link rel='stylesheet' href='https://${DOMAIN}/css/addons/unraid/login-page/${TYPE}/${THEME}'>" ${LOGIN_PAGE}
      echo 'Stylesheet set to' ${THEME}
    fi


    This is my white.css that I use:

    /*_____________________WHITE_THEME______________________*/
    /* --body-before:#00ff771a; /* This is the background that creates the crt lines, background uses a transparency of 10% SET TO NONE TO REMOVE CRT EFFECT */
    /* --body-after: #00ff7733; /* This is the background that creates the crt lines, background uses a transparency of 20% SET TO NONE TO REMOVE CRT EFFECT */
    /* --body-animation: flicker; This is the background that flickers. SET TO NONE TO REMOVE THE FLICKER ANIMATION! */
    /* --custom-text-header-animation: textflicker; /* SET TO NONE TO REMOVE THE FLICKER ANIMATION! */
    
    @import url(https://thijselblaso.github.io/theme.park.edit/CSS/addons/unraid/login-page/retro-terminal/retro-terminal-base.css);
    :root {
    --main-bg-color:black;
    --body-before:#70d7f61a;
    --body-after: none;
    --body-animation: none;
    --logo: url(https://i.imgur.com/rLGePdW.png) center no-repeat;
    --text-color: #ffffff;
    --input-color: #ffffff;
    --link-color: #ffffff;
    --link-color-hover: #e68a00;
    --case-color: #ffffff;
    --button-text-color: #ffffff;
    --button-text-color-hover: #000;
    --button-color: #ffffff;
    --button-color-hover: #4caf50;
    --selection-color: #e68a00;
    --custom-text-header:#ffffff;
    --custom-text-header-shadow:#ffffff;
    --custom-text-header-animation: none;
    --input-font: 'Share Tech Mono', monospace;
    --text-font: 'Share Tech Mono', monospace;
    --loginbox-background-color: transparent;
    --text-shadow: 0 0 8px;
    --text-shadow-color: #000000;
    --box-shadow: 0 0 15px;
    }

     

    • Like 1
×
×
  • Create New...