Write out the debug messages (from the previous commit) only if

the evaluated command exists.

Approved by: markm (mentor)(implicit)
This commit is contained in:
Mike Makonnen 2003-01-20 19:30:15 +00:00
parent 1d4a6490ba
commit 03891d9007
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=109582

View File

@ -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
;;