Allow --dump and -e options to ignore errors
authorMartin Schwenke <martin@meltin.net>
Tue, 12 Mar 2013 04:36:12 +0000 (15:36 +1100)
committerMartin Schwenke <martin@meltin.net>
Tue, 12 Mar 2013 04:57:48 +0000 (15:57 +1100)
Signed-off-by: Martin Schwenke <martin@meltin.net>
autocluster

index 06cc14fa99c4396d6b3cc4bec63128dca424a4c0..37681a89807dee7d94031b2e1287cb32f1aab217 100755 (executable)
@@ -79,8 +79,12 @@ EOF
 ###############################
 
 die () {
-    fill_text 0 "ERROR: $*" >&2
-    exit 1
+    if [ "$no_sanity" = 1 ] ; then
+       fill_text 0 "WARNING: $*" >&2
+    else
+       fill_text 0 "ERROR: $*" >&2
+       exit 1
+    fi
 }
 
 ###############################
@@ -1157,10 +1161,10 @@ while true ; do
     case "$1" in
        # force at least ./local_file to avoid accidental file from $PATH
        -c) . "$(dirname $2)/$(basename $2)" ; shift 2 ;;
-       -e) run_hooks post_config_hooks ; eval "$2" ; exit ;;
+       -e) no_sanity=1 ; run_hooks post_config_hooks ; eval "$2" ; exit ;;
        -E) eval "$2" ; shift 2 ;;
        -x) set -x; shift ;;
-       --dump) run_hooks post_config_hooks ; dump_config ;;
+       --dump) no_sanity=1 ; run_hooks post_config_hooks ; dump_config ;;
        --) shift ; break ;;
        -h|--help) usage ;; # Redundant.
        --*)