On 02/04/13 22:09, Peter Bisroev wrote:
> Hi Guys,
>
> That is what I suspected.
>
> I can obviously patch the scripts up for now, but long term, should we have a
> VERBOSESTATUS equivalent flag to complement ROOTBACKUP?
Not sure. As VERBOSESTATUS already has it's special meaning, I'm
thinking along the lines of a more generic QUIET variable,
accompanied with sth like what's below, parts of which might be
considered overkill. Maybe it is all overkill.
- - - - - - -
QUIET=false
do_part() {
local _err;
"$@" && return
_err=$?
QUIET=false
return $_err;
# Or simpler but less fine-grained:
"$@" || ! QUIET=false
}
...
run_script "daily.local" # override QUIET at will
[ true != "$QUIET" ] || QUIET=false
...
start_part checking foo
do_part echo "doing bar"
do_part cat /nonexistant # disables QUIET operation
...
if ! $QUIET && [ -s $MAINOUT ]; then
mail -s "`hostname` daily insecurity output" root < $MAINOUT
fi
- - - - - - -
/Alexander