Correction bug sevrer_menu
Correction du bug sur le script de server_menu détecté lors des phases de tests en direct après la précédente modification. Désormais le message de sélection invalide est le seul affiché.
This commit is contained in:
parent
8cd1e8d5d3
commit
e95326ab31
@ -31,11 +31,11 @@ function main_menu () {
|
|||||||
read -r -p "Votre choix (1-$counter): " choice
|
read -r -p "Votre choix (1-$counter): " choice
|
||||||
|
|
||||||
if [ "$choice" == "quit" ]; then
|
if [ "$choice" == "quit" ]; then
|
||||||
|
echo "Déconnexion du bastion."
|
||||||
exit 0
|
exit 0
|
||||||
elif [ -z "$choice" ] || [ -z "${server_map[$choice]}" ]; then
|
elif [ -z "$choice" ] || [ -z "${server_map[$choice]}" ]; then
|
||||||
echo "Sélection invalide."
|
echo "Sélection invalide."
|
||||||
fi
|
else
|
||||||
|
|
||||||
selected_server="${server_map[$choice]}"
|
selected_server="${server_map[$choice]}"
|
||||||
echo "Connexion à $selected_server..."
|
echo "Connexion à $selected_server..."
|
||||||
if [ -z "$(echo "$selected_server" | cut -d ' ' -f 4)" ]; then
|
if [ -z "$(echo "$selected_server" | cut -d ' ' -f 4)" ]; then
|
||||||
@ -47,6 +47,7 @@ function main_menu () {
|
|||||||
ttyrec -z --"$(echo "$selected_server" | cut -d ' ' -f 1)"-"$(echo "$selected_server" | cut -d ' ' -f 3)"-- -k 300 --warn-before-kill 60 -- ssh -p "$(echo "$selected_server" | cut -d ' ' -f 2)" -i /home/"$CONNECTED_USER"/"$(echo "$selected_server" | cut -d ' ' -f 4)" "$(echo "$selected_server" | cut -d ' ' -f 3)"@"$(echo "$selected_server" | cut -d ' ' -f 1)"
|
ttyrec -z --"$(echo "$selected_server" | cut -d ' ' -f 1)"-"$(echo "$selected_server" | cut -d ' ' -f 3)"-- -k 300 --warn-before-kill 60 -- ssh -p "$(echo "$selected_server" | cut -d ' ' -f 2)" -i /home/"$CONNECTED_USER"/"$(echo "$selected_server" | cut -d ' ' -f 4)" "$(echo "$selected_server" | cut -d ' ' -f 3)"@"$(echo "$selected_server" | cut -d ' ' -f 1)"
|
||||||
rm -rf /home/"${CONNECTED_USER:?}"/"$(echo "$selected_server" | cut -d ' ' -f 4)"
|
rm -rf /home/"${CONNECTED_USER:?}"/"$(echo "$selected_server" | cut -d ' ' -f 4)"
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
while true; do
|
while true; do
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user