summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authormtm <mtm@FreeBSD.org>2003-01-20 19:30:15 +0000
committermtm <mtm@FreeBSD.org>2003-01-20 19:30:15 +0000
commit83c819b8cae6cc678fef81bd92cd01016bdf866b (patch)
treed9623d03d2281c7bc475a8102c15cd35e9860dd9 /etc
parent87070773e0e4ba031b98f91fd98d0961d03e2b93 (diff)
downloadFreeBSD-src-83c819b8cae6cc678fef81bd92cd01016bdf866b.zip
FreeBSD-src-83c819b8cae6cc678fef81bd92cd01016bdf866b.tar.gz
Write out the debug messages (from the previous commit) only if
the evaluated command exists. Approved by: markm (mentor)(implicit)
Diffstat (limited to 'etc')
-rw-r--r--etc/rc.subr16
1 files changed, 11 insertions, 5 deletions
diff --git a/etc/rc.subr b/etc/rc.subr
index 05225a6..48f68e1 100644
--- a/etc/rc.subr
+++ b/etc/rc.subr
@@ -535,16 +535,20 @@ run_rc_command()
# if the precmd failed and force
# isn't set, exit
#
- debug "run_rc_command: evaluating ${_precmd}()."
+ [ -n "$_precmd" ] &&
+ debug "run_rc_command: evaluating ${_precmd}()."
if ! eval $_precmd && [ -z "$rc_force" ]; then
return 1
fi
- debug "run_rc_command: evaluating ${_cmd}()."
+ [ -n "$_cmd" ] &&
+ debug "run_rc_command: evaluating ${_cmd}()."
if ! eval $_cmd && [ -z "$rc_force" ]; then
return 1
fi
- debug "run_rc_command: evaluating ${_postcmd}()."
+
+ [ -n "$_postcmd" ] &&
+ debug "run_rc_command: evaluating ${_postcmd}()."
eval $_postcmd
return 0
fi
@@ -602,7 +606,8 @@ run_rc_command()
# if the precmd failed and force
# isn't set, exit
#
- debug "run_rc_command: evaluating ${_precmd}()."
+ [ -n "${_precmd}" ] &&
+ debug "run_rc_command: evaluating ${_precmd}()."
if ! eval $_precmd && [ -z "$rc_force" ]; then
return 1
fi
@@ -635,7 +640,8 @@ $command $rc_flags $command_args"
# finally, run postcmd
#
- debug "run_rc_command: evaluating ${_postcmd}()."
+ [ -n "${_postcmd}" ] &&
+ debug "run_rc_command: evaluating ${_postcmd}()."
eval $_postcmd
;;
OpenPOWER on IntegriCloud