diff --git a/menu/pgscan/pgscan.sh b/menu/pgscan/pgscan.sh index 1371f230..8d1101c5 100644 --- a/menu/pgscan/pgscan.sh +++ b/menu/pgscan/pgscan.sh @@ -41,6 +41,13 @@ EOF fi } +user () { + touch /var/plexguide/plex.pw + user=$(cat /var/plexguide/plex.pw) + if [ "$user" == "" ]; then + bash /opt/plexguide/menu/pgscan/scripts/plex_pw.sh + fi +} token() { touch /opt/appdata/pgscan/plex.token ptoken=$(cat /opt/appdata/pgscan/plex.token) @@ -59,7 +66,6 @@ EOF fi fi } - # BAD INPUT badinput() { echo @@ -135,6 +141,7 @@ EOF # FUNCTIONS END ############################################################## plexcheck +user token deploycheck question1 diff --git a/menu/pgscan/scripts/plex_pw.sh b/menu/pgscan/scripts/plex_pw.sh new file mode 100644 index 00000000..80df8e0f --- /dev/null +++ b/menu/pgscan/scripts/plex_pw.sh @@ -0,0 +1,142 @@ +#!/bin/bash +# +# Title: PGBlitz (Reference Title File) +# Author(s): Admin9705 - Deiteq +# URL: https://pgblitz.com - http://github.pgblitz.com +# GNU: General Public License v3.0 +################################################################################ + +# FUNCTIONS START ############################################################## + +# BAD INPUT +badinput() { + echo + read -p '⛔️ ERROR - BAD INPUT! | PRESS [ENTER] ' typed /var/plexguide/plex.pw + echo "$user" >/var/plexguide/plex.user + ansible-playbook /opt/plexguide/menu/plex/token.yml + token=$(cat /var/plexguide/plex.token) + if [ "$token" != "" ]; then + tee <<-EOF + +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +✅️ Details stored Succeeded! +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +EOF + sleep 4 + else + tee <<-EOF + +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ +⛔️ Details Failed! +━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ + +NOTE: Process will repeat until you succeed or exit! + +EOF + read -p 'Confirm Info | Press [ENTER] ' typed