diff options
author | Martin Schwenke <martin@meltin.net> | 2013-03-12 15:36:12 +1100 |
---|---|---|
committer | Martin Schwenke <martin@meltin.net> | 2013-03-12 15:57:48 +1100 |
commit | 6bddfc57ccc124906f6770c35d43c0f158efb811 (patch) | |
tree | 7a7f333c82f8594b36d1474fba307e310354a58f /autocluster | |
parent | 78728fb1534842d127e9665f4dabee36f0ef215a (diff) | |
download | autocluster-6bddfc57ccc124906f6770c35d43c0f158efb811.tar.gz autocluster-6bddfc57ccc124906f6770c35d43c0f158efb811.tar.xz autocluster-6bddfc57ccc124906f6770c35d43c0f158efb811.zip |
Allow --dump and -e options to ignore errors
Signed-off-by: Martin Schwenke <martin@meltin.net>
Diffstat (limited to 'autocluster')
-rwxr-xr-x | autocluster | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/autocluster b/autocluster index 06cc14f..37681a8 100755 --- a/autocluster +++ b/autocluster @@ -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. --*) |