Skip to content

Commit

Permalink
Update token.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
MrDoobPG authored and MrDoobPG committed Nov 2, 2019
1 parent 5dc752b commit a7f9c30
Showing 1 changed file with 32 additions and 3 deletions.
35 changes: 32 additions & 3 deletions menu/plex/token.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ EOF
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
read -p 'Enter the PLEX User Name | Press [ENTER]: ' user </dev/tty
read -p 'Enter the PLEX User Passwort | Press [ENTER]: ' pw </dev/tty

tee <<-EOF
Expand All @@ -63,7 +63,7 @@ EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
sleep 3
question2
tokenexist

pw=$(cat /var/plexguide/plex.pw)
user=$(cat /var/plexguide/plex.user)
Expand Down Expand Up @@ -142,6 +142,35 @@ EOF
fi
}

tokenexist(){
pw=$(cat /var/plexguide/plex.pw)
user=$(cat /var/plexguide/plex.user)
ansible-playbook /opt/plexguide/menu/plex/token.yml
token=$(cat /var/plexguide/plex.token)
token=$(cat /var/plexguide/plex.token)
if [ "$token" != "" ]; then
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✅️ PlexToken Generation Succeeded!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
sleep 4
else
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⛔️ PlexToken Generation Failed!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
NOTE: Process will repeat until you succeed or exit!
EOF
read -p 'Confirm Info | Press [ENTER] ' typed </dev/tty
question1
fi
}

# FUNCTIONS END ##############################################################

question1

0 comments on commit a7f9c30

Please sign in to comment.