From d3d324038ab24bf2f7b1ba18c2d47b1799f9d9c5 Mon Sep 17 00:00:00 2001 From: Maaike Date: Tue, 15 Oct 2024 11:26:21 +0200 Subject: [PATCH] use return instead of exit in setup_student_vm.sh --- environment/setup_student_vm.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/environment/setup_student_vm.sh b/environment/setup_student_vm.sh index 96853f62..8090f068 100644 --- a/environment/setup_student_vm.sh +++ b/environment/setup_student_vm.sh @@ -7,7 +7,7 @@ if [ $# -eq 0 ] then echo "No arguments supplied" echo "Usage: ./setup_student_vm.sh " - exit 1 + return 1 fi # first argument of the script is the username @@ -16,9 +16,9 @@ USERNAME=$1 HOST_IP=$2 echo "USERNAME=`echo $USERNAME`" -read -p "Continue? (Y/N): " confirm && [[ $confirm == [yY] || $confirm == [yY][eE][sS] ]] || exit 1 +read -p "Continue? (Y/N): " confirm && [[ $confirm == [yY] || $confirm == [yY][eE][sS] ]] || return 1 echo "HOST_IP=`echo $HOST_IP`" -read -p "Continue? (Y/N): " confirm && [[ $confirm == [yY] || $confirm == [yY][eE][sS] ]] || exit 1 +read -p "Continue? (Y/N): " confirm && [[ $confirm == [yY] || $confirm == [yY][eE][sS] ]] || return 1 # execute commands over ssh @@ -37,7 +37,7 @@ ssh -o StrictHostKeyChecking=no wmo_admin@`echo $HOST_IP` "sudo unzip -o /tmp/wi ssh -o StrictHostKeyChecking=no wmo_admin@`echo $HOST_IP` "rm -rf /tmp/wis2box-setup-1.0b8.zip" # copy the latest exercise materials to the student-vm -ssh -o StrictHostKeyChecking=no wmo_admin@`echo $HOST_IP` "wget https://training.wis2box.wis2dev.io/exercise-materials.zip -O /tmp/exercise-materials.zip" +ssh -o StrictHostKeyChecking=no wmo_admin@`echo $HOST_IP` "wget https://training.wis2box.wis.wmo.int/exercise-materials.zip -O /tmp/exercise-materials.zip" # unzip the exercise-materials.zip ssh -o StrictHostKeyChecking=no wmo_admin@`echo $HOST_IP` "sudo unzip -o /tmp/exercise-materials.zip -d /home/`echo $USERNAME`/" # remove the exercise-materials.zip