forked from HawksRepos/PTS-Team
-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pgscan update / sgtore details for pgscan
- Loading branch information
MrDoobPG
authored and
MrDoobPG
committed
Oct 24, 2019
1 parent
c16f4cd
commit 1ad6781
Showing
3 changed files
with
151 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 </dev/tty | ||
question1 | ||
} | ||
|
||
badinput2() { | ||
echo | ||
read -p '⛔️ ERROR - BAD INPUT! | PRESS [ENTER] ' typed </dev/tty | ||
question2 | ||
} | ||
|
||
# FIRST QUESTION | ||
|
||
question1() { | ||
tee <<-EOF | ||
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ | ||
🌎 Plex User Name Store | ||
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ | ||
[1] - Generate stored details for PTS - PAS - Scan | ||
[Z] - Exit | ||
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ | ||
EOF | ||
read -p 'Make a Selection | Press [ENTER]: ' typed </dev/tty | ||
echo | ||
|
||
if [ "$typed" == "1" ]; then | ||
read -p 'Enter the PLEX User Name | Press [ENTER]: ' user </dev/tty | ||
read -p 'Enter the PLEX User Pass | Press [ENTER]: ' pw </dev/tty | ||
|
||
tee <<-EOF | ||
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ | ||
🍖 NOM NOM - Saved Your Information! | ||
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ | ||
EOF | ||
sleep 3 | ||
question2 | ||
elif [ "$typed" == "2" ]; then | ||
|
||
tee <<-EOF | ||
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ | ||
🍖 NOM NOM - Read Your Information! | ||
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ | ||
EOF | ||
sleep 3 | ||
question 2 | ||
|
||
pw=$(cat /var/plexguide/plex.pw) | ||
user=$(cat /var/plexguide/plex.user) | ||
|
||
elif [[ "$typed" == "Z" || "$typed" == "z" ]]; then | ||
exit | ||
else badinput; fi | ||
} | ||
|
||
question2() { | ||
tee <<-EOF | ||
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ | ||
📂 User Name & Password Confirmation | ||
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ | ||
User Name: $user | ||
User Pass: $pw | ||
⚠️ Information Correct? | ||
[1] YES | ||
[2] NO | ||
[Z] - Exit Interface | ||
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ | ||
EOF | ||
read -p 'Make a Selection | Press [ENTER]: ' typed </dev/tty | ||
|
||
if [ "$typed" == "1" ]; then | ||
tee <<-EOF | ||
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ | ||
🍖 NOM NOM - Got It! | ||
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ | ||
NOTE: If the token is bad, this process will repeat again! | ||
EOF | ||
sleep 4 | ||
question3 | ||
elif [ "$typed" == "2" ]; then | ||
question1 | ||
elif [[ "$typed" == "Z" || "$typed" == "z" ]]; then | ||
exit | ||
else badinput2; fi | ||
} | ||
|
||
question3() { | ||
echo "$pw" >/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 </dev/tty | ||
question1 | ||
fi | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters