From aa18bf14450688a94602523e7a934af267bc45a4 Mon Sep 17 00:00:00 2001 From: Ludovic Pouzenc Date: Wed, 27 Sep 2017 18:16:31 +0200 Subject: autoruns : do checks before letting the user cancel the choosen action --- nfs/autorun.sh | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'nfs') diff --git a/nfs/autorun.sh b/nfs/autorun.sh index 4d6461a..7c642d1 100755 --- a/nfs/autorun.sh +++ b/nfs/autorun.sh @@ -1,6 +1,11 @@ #!/bin/busybox sh -read -t10 -p 'Press Enter or wait 10 sec...' # Let the user read machine_info and other usefull informations on console (or skip with Enter) -echo -e '\n\n\n\n\n' # Make some blank lines on console + +rest10() { + # Let the user read machine_info and other usefull informations on console (or skip with Enter) + read -t10 -p 'Press Enter or wait 10 sec...' + # Make some blank lines on console + echo -e '\n\n\n\n\n' +} # Define some handy variables imagedir=/mnt/nfs/images @@ -17,12 +22,14 @@ firstdisk_test || exit 2 # Run the main action script if nfswrite_test -then # Start deploy script - source $scriptdir/image_deploy.sh +then rest10 # Let user cancel it + source $scriptdir/image_deploy.sh # Start deploy script else # Start capture script if all it needs is available if scriptavailability_test image_capture_${hostname}.sh - then source $scriptdir/image_capture.sh + then rest10 # Let user cancel it + source $scriptdir/image_capture.sh + # else No wait, nothing to do, go to eficast_end directly fi fi -- cgit v1.2.3