From 1ad67816317e70c034e2cea40814bf5481f1abc7 Mon Sep 17 00:00:00 2001 From: MrDoobPG <46342172+MrDoobPG@users.noreply.github.com> Date: Thu, 24 Oct 2019 22:55:08 +0200 Subject: [PATCH] pgscan update / sgtore details for pgscan --- menu/pgscan/pgscan.sh | 9 +- menu/pgscan/scripts/plex_pw.sh | 142 ++++++++++++++++++++++++++++++ menu/pgscan/scripts/plex_token.sh | 1 + 3 files changed, 151 insertions(+), 1 deletion(-) create mode 100644 menu/pgscan/scripts/plex_pw.sh 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