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
|
clear
|
||||||
echo " Connecting to Server"
|
echo " Connecting to Server"
|
||||||
echo "------------------------------------------------------------"
|
echo "------------------------------------------------------------"
|
||||||
# Add a chck before connecting to the session if the session already exists
|
if tmux has-session -t ${server_name} 2>/dev/null; then
|
||||||
# if not promt the user to start it manually
|
|
||||||
# -----------------------------------------------------------------------------
|
|
||||||
# Attaches to the running tmux session of the server if the session exists
|
# Attaches to the running tmux session of the server if the session exists
|
||||||
tmux a -t "${server_name}"
|
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..."
|
read -p "Press Enter to continue..."
|
||||||
|
fi
|
||||||
break
|
break
|
||||||
;;
|
;;
|
||||||
"Set EULA")
|
"Set EULA")
|
||||||
|
|||||||
Reference in New Issue
Block a user