diff --git a/menu/pgscan/pgscan.sh b/menu/pgscan/pgscan.sh index bf37ad77..84489dbc 100644 --- a/menu/pgscan/pgscan.sh +++ b/menu/pgscan/pgscan.sh @@ -67,26 +67,6 @@ badinput() { question1 } -# Print Plex Autoscan URL -showupdomain() { -#If SERVER_IP is 0.0.0.0, assign public IP address to REAL_IP. -SERVER_IP=$(ip a | grep glo | awk '{print $2}' | head -1 | cut -f1 -d/) -SUBDOMAIN=$(cat /var/plexguide/server.domain) -PAS_CONFIG="/opt/appdata/pgscan/config/config.json" - - SERVER_IP=$(cat ${PAS_CONFIG} | jq -r .SERVER_IP) - SERVER_PORT=$(cat ${PAS_CONFIG} | jq -r .SERVER_PORT) - SERVER_PASS=$(cat ${PAS_CONFIG} | jq -r .SERVER_PASS) - - if (( SIMPLE - 1 )); then - echo "Your Plex Autoscan URL:" - echo "http://${SUBDOMAIN}:${SERVER_PORT}/${SERVER_PASS}" - echo "" - else - echo http://${SUBDOMAIN}:${SERVER_PORT}/${SERVER_PASS} - fi -} - # FIRST QUESTION question1() { @@ -111,12 +91,29 @@ EOF ansible-playbook /opt/plexguide/menu/pgscan/pgscan.yml ansible-playbook /opt/plexguide/menu/pgscan/alias/alias.yml question1 + elif [ "$typed" == "2" ]; then + showupdomain elif [[ "$typed" == "Z" || "$typed" == "z" ]]; then exit else badinput; fi } showupdomain() { +#If SERVER_IP is 0.0.0.0, assign public IP address to REAL_IP. +SERVER_IP=$(ip a | grep glo | awk '{print $2}' | head -1 | cut -f1 -d/) +SUBDOMAIN=$(cat /var/plexguide/server.domain) +PAS_CONFIG="/opt/appdata/pgscan/config/config.json" + SERVER_IP=$(cat ${PAS_CONFIG} | jq -r .SERVER_IP) + SERVER_PORT=$(cat ${PAS_CONFIG} | jq -r .SERVER_PORT) + SERVER_PASS=$(cat ${PAS_CONFIG} | jq -r .SERVER_PASS) + + if (( SIMPLE - 1 )); then + echo "Your Plex Autoscan URL:" + echo "http://${SUBDOMAIN}:${SERVER_PORT}/${SERVER_PASS}" + echo "" + else + echo http://${SUBDOMAIN}:${SERVER_PORT}/${SERVER_PASS} + fi tee <<-EOF ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━