bug fix
[automated-distro-installer] / fai / config / class / 41-warning.sh
index 4f6e6f26358d219799a07b1e5807d8bf7c76d93d..f66085d52d40cb3a3a1053d3161e257e86827ca2 100755 (executable)
@@ -13,6 +13,19 @@ grep -q INSTALL $LOGDIR/FAI_CLASSES || return 0
 [ "$flag_menu" ] || return 0
 
 out=$(tty)
+# save stdout and redirect stdout to tty
+exec 4>&1 > $out
+red=$(mktemp)
+echo 'screen_color = (CYAN,RED,ON)' > $red
 
-dialog --colors --clear --aspect 6 --title "FAI - Fully Automatic Installation" --trim \
-               --msgbox "\n\n        If you continue,       \n   all your data on the disk   \n                               \n|\Zr\Z1       WILL BE DESTROYED     \Z0\Zn|\n\n" 0 0 1>$out
+DIALOGRC=$red dialog --colors --clear --aspect 6 --title "FAI - Fully Automatic Installation" --trim \
+               --msgbox "\n\n        If you continue,       \n   all your data on the disk   \n                               \n|\Zr\Z1       WILL BE DESTROYED     \Z0\Zn|\n\n" 0 0
+
+# stop on any error, or if ESC was hit
+if [ $? -ne 0 ]; then
+    task_error 999
+fi
+
+rm $red
+unset red
+exec 1>&4 # restore stdout