mirror of
https://github.com/CerberusV1/minecraft_deploy.git
synced 2026-01-13 03:23:42 +01:00
added check for the session before attempting to connect to avoid exiting the script
This commit is contained in:
@@ -76,12 +76,13 @@ while true; do
|
||||
clear
|
||||
echo " Connecting to Server"
|
||||
echo "------------------------------------------------------------"
|
||||
# Add a chck before connecting to the session if the session already exists
|
||||
# if not promt the user to start it manually
|
||||
# -----------------------------------------------------------------------------
|
||||
# Attaches to the running tmux session of the server if the session exists
|
||||
tmux a -t "${server_name}"
|
||||
read -p "Press Enter to continue..."
|
||||
if tmux has-session -t ${server_name} 2>/dev/null; then
|
||||
# Attaches to the running tmux session of the server if the session exists
|
||||
tmux a -t "${server_name}"
|
||||
else
|
||||
echo "You need to start the server before trying to connect to it."
|
||||
read -p "Press Enter to continue..."
|
||||
fi
|
||||
break
|
||||
;;
|
||||
"Set EULA")
|
||||
|
||||
Reference in New Issue
Block a user