From 03891d900732d7a300c99e4bbd19316d44f0c150 Mon Sep 17 00:00:00 2001 From: Mike Makonnen Date: Mon, 20 Jan 2003 19:30:15 +0000 Subject: [PATCH] Write out the debug messages (from the previous commit) only if the evaluated command exists. Approved by: markm (mentor)(implicit) --- etc/rc.subr | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/etc/rc.subr b/etc/rc.subr index 05225a6073da..48f68e167fc3 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 ;;