X-Git-Url: https://git.madduck.net/code/molly-guard.git/blobdiff_plain/3fb8d0418be397c5f4e29aa2e74dd2cf378b68e0..946cdc2f1df4ba60775d48f9d652344e29ec4186:/shutdown diff --git a/shutdown b/shutdown index be733b7..3ffacc9 100755 --- a/shutdown +++ b/shutdown @@ -10,7 +10,6 @@ set -eu ME=molly-guard VERSION=0.4 SCRIPTSDIR=/etc/molly-guard/run.d -SCRIPTSDIR="${0%/*}/run.d" CMD="${0##*/}" EXEC="/sbin/$CMD" @@ -90,27 +89,27 @@ do_real_cmd() } if [ $DO_NOTHING -eq 1 ]; then - echo "I: demo mode; $ME will not do anything due to --molly-guard-do-nothing." + echo "I: demo mode; $ME will not do anything due to --molly-guard-do-nothing." >&2 fi # pass through certain commands case "$CMD $CMDARGS" in (*shutdown\ *-c*) # allow canceling shutdowns - echo "I: executing $CMD $CMDARGS regardless of check results." + echo "I: executing $CMD $CMDARGS regardless of check results." >&2 do_real_cmd ;; esac MOLLYGUARD_CMD=$CMD; export MOLLYGUARD_CMD MOLLYGUARD_DO_NOTHING=$DO_NOTHING; export MOLLYGUARD_DO_NOTHING -MOLLYGUARD_SETTINGS="/etc/default/$ME"; export MOLLYGUARD_SETTINGS +MOLLYGUARD_SETTINGS="/etc/molly-guard/rc"; export MOLLYGUARD_SETTINGS for script in $(run-parts --test $SCRIPTSDIR); do ret=0 eval $script $SCRIPTARGS || ret=$? if [ $ret -ne 0 ]; then - echo "W: aborting $CMD due to ${script##*/} exiting with code $ret." + echo "W: aborting $CMD due to ${script##*/} exiting with code $ret." >&2 exit $ret fi done