From a8f8900664795dfc26597e0fd8b6c76d7f7eaaa6 Mon Sep 17 00:00:00 2001
From: Ludovic Pouzenc <ludovic@pouzenc.fr>
Date: Sat, 21 Oct 2017 19:28:30 +0200
Subject: Make sound working, rework on rescue logic, limit shell levels

---
 nfs/autorun.sh | 18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

(limited to 'nfs/autorun.sh')

diff --git a/nfs/autorun.sh b/nfs/autorun.sh
index a998b13..ad99a8e 100755
--- a/nfs/autorun.sh
+++ b/nfs/autorun.sh
@@ -2,7 +2,7 @@
 
 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...'
+	sfx_question ; read -t10 -p 'Press Enter or wait 10 sec...'
 	# Make some blank lines on console
 	echo -e '\n\n\n\n\n'
 }
@@ -22,16 +22,10 @@ firstdisk_test || exit 2
 
 # Run the main action script
 if nfswrite_test
-then	rest10 # Let user cancel it
-	source $scriptdir/image_deploy.sh # Start deploy script
+then	# Start deploy script after letting a chance to cancel it
+	rest10 ; source $scriptdir/image_deploy.sh
 
-else	# Start capture script if all it needs is available
-	if scriptavailability_test image_capture_${hostname}.sh
-	then	rest10 # Let user cancel it
-		source $scriptdir/image_capture.sh
-	# else No wait, nothing to do, go to eficast_end directly
-	fi
+else	scriptavailability_test image_capture_${hostname}.sh || exit 3
+	# Start capture script if all it needs is available
+	rest10 ; source $scriptdir/image_capture.sh
 fi
-
-# Display ending message then reboot
-eficast_end
-- 
cgit v1.2.3