Skip to content

Commit

Permalink
server ID changer
Browse files Browse the repository at this point in the history
  • Loading branch information
MrDoobPG authored and MrDoobPG committed Nov 27, 2019
1 parent 77fcd84 commit 66c21aa
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 53 deletions.
33 changes: 3 additions & 30 deletions menu/functions/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,7 @@ newinstall() {
}

pgdeploy() {
touch ${abc}/pg.edition
bash /opt/plexguide/menu/start/start.sh
touch ${abc}/pg.edition && bash /opt/plexguide/menu/start/start.sh
}

pgedition() {
Expand Down Expand Up @@ -314,31 +313,5 @@ dockerinstall() {
}

serverid() {
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
↘️ Establishing Server ID 💬 Use One Word & Keep it Simple
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p '🌏 TYPE Server ID | Press [ENTER]: ' typed </dev/tty

if [ "$typed" == "" ]; then
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⛔️ WARNING! - The Server ID Cannot Be Blank!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
sleep 1
serverid
else
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✅️ PASS: Server ID $typed Established
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
echo "$typed" >${abc}/server.id
sleep 1
fi
}
bash /opt/plexguide/menu/functions/serverid.sh
}
42 changes: 42 additions & 0 deletions menu/functions/serverid.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/bash
#
# Title: PTS ServerID
# org. Author(s): Admin9705 - Deiteq
# Mod from MrDoob for PTS
# GNU: General Public License v3.0
################################################################################
touch /var/plexguide/server.id.stored
start=$(cat /var/plexguide/server.id)
stored=$(cat /var/plexguide/server.id.stored)
source /opt/plexguide/menu/functions/functions.sh
abc="/var/plexguide"

serverid() {
if [ "$start" != "$stored" ]; then

tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
↘️ Establishing Server ID 💬 Use One Word & Keep it Simple
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
read -p '🌏 TYPE Server ID | Press [ENTER]: ' typed </dev/tty

if [ "$typed" == "" ]; then
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⛔️ WARNING! - The Server ID Cannot Be Blank!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
sleep 1
serverid
else
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✅️ PASS: Server ID $typed Established
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
echo "$typed" >${abc}/server.id
cat ${abc}/server.id >${abc}/server.id.stored
sleep 1
fi
}
37 changes: 14 additions & 23 deletions menu/interface/serverid.sh
Original file line number Diff line number Diff line change
@@ -1,51 +1,42 @@
#!/bin/bash
#
# Title: PGBlitz (Reference Title File)
# Author(s): Admin9705 - Deiteq
# URL: https://pgblitz.com - http://github.pgblitz.com
# Title: PTS ServerID
# org. Author(s): Admin9705 - Deiteq
# Mod from MrDoob for PTS
# GNU: General Public License v3.0
################################################################################
touch /var/plexguide/server.id.stored
start=$(cat /var/plexguide/server.id)
stored=$(cat /var/plexguide/server.id.stored)
source /opt/plexguide/menu/functions/functions.sh
abc="/var/plexguide"

serverid() {
if [ "$start" != "$stored" ]; then

tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
↘️ ESTABLISHING ~ Server's Identification
↘️ Establishing Server ID 💬 Use One Word & Keep it Simple
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚠️ WARNING: Use > One Word - All LowerCase & Keep it Simple!
EOF

# Standby
read -p '🌏 TYPE Server ID | Press [ENTER]: ' typed </dev/tty

if [ "$typed" == "" ]; then
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⛔️ WARNING! - The Server ID Cannot Be Blank!
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF
sleep 3
bash /opt/plexguide/menu/interface/serverid.sh
exit
sleep 1
serverid
else
tee <<-EOF
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✅️ PASS: ServerID Set
✅️ PASS: Server ID $typed Established
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
EOF

# Prevents From Repeating
echo "$typed" >/var/plexguide/server.id
cat /var/plexguide/server.id >/var/plexguide/server.id.stored

sleep 3
echo "$typed" >${abc}/server.id
cat ${abc}/server.id >${abc}/server.id.stored
sleep 1
fi

fi
}
2 changes: 2 additions & 0 deletions menu/interface/settings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ touch /var/plexguide/pgui.switch
[4] Comm UI : [ $switchcheck ] | Port [ $ports ] | pgui.$domain
[5] Emergency Display : [ $emdisplay ]
[6] System & Network Auditor
[7] Server ID change : Change your ServerID
[99] TroubleShoot : PreInstaller
Expand Down Expand Up @@ -101,6 +102,7 @@ EOF
else echo "On" >/var/plexguide/emergency.display; fi
setstart ;;
6) bash /opt/plexguide/menu/functions/network.sh && clear && setstart ;;
7) serverid && clear && setstart ;;
99) bash /opt/plexguide/menu/functions/tshoot.sh && clear && setstart ;;
z) exit ;;
Z) exit ;;
Expand Down

0 comments on commit 66c21aa

Please sign in to comment.