Back out rev. 1.63. It was a poor idea because
test(1) is built in sh(1) and it always evaluates both sides of -a or -o, unlike && or || in sh(1). Requested by: dougb
This commit is contained in:
parent
6358aecacd
commit
d1b4fdece5
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=160698
24
etc/rc.subr
24
etc/rc.subr
@ -575,14 +575,16 @@ run_rc_command()
|
||||
debug "run_rc_command: evaluating ${_precmd}()."
|
||||
eval $_precmd $rc_extra_args
|
||||
_return=$?
|
||||
[ $_return -ne 0 -a -z "$rc_force" ] && return 1
|
||||
[ $_return -ne 0 ] && [ -z "$rc_force" ] &&
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [ -n "$_cmd" ]; then
|
||||
debug "run_rc_command: evaluating ${_cmd}()."
|
||||
eval $_cmd $rc_extra_args
|
||||
_return=$?
|
||||
[ $_return -ne 0 -a -z "$rc_force" ] && return 1
|
||||
[ $_return -ne 0 ] && [ -z "$rc_force" ] &&
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [ -n "$_postcmd" ]; then
|
||||
@ -650,7 +652,8 @@ run_rc_command()
|
||||
debug "run_rc_command: evaluating ${_precmd}()."
|
||||
eval $_precmd
|
||||
_return=$?
|
||||
[ $_return -ne 0 -a -z "$rc_force" ] && return 1
|
||||
[ $_return -ne 0 ] && [ -z "$rc_force" ] &&
|
||||
return 1
|
||||
fi
|
||||
|
||||
# setup the full command to run
|
||||
@ -678,7 +681,7 @@ $command $rc_flags $command_args"
|
||||
debug "run_rc_command: _doit: $_doit"
|
||||
eval $_doit
|
||||
_return=$?
|
||||
[ $_return -ne 0 -a -z "$rc_force" ] && return 1
|
||||
[ $_return -ne 0 ] && [ -z "$rc_force" ] && return 1
|
||||
|
||||
# finally, run postcmd
|
||||
#
|
||||
@ -706,7 +709,8 @@ $command $rc_flags $command_args"
|
||||
if [ -n "$_precmd" ]; then
|
||||
eval $_precmd
|
||||
_return=$?
|
||||
[ $_return -ne 0 -a -z "$rc_force" ] && return 1
|
||||
[ $_return -ne 0 ] && [ -z "$rc_force" ] &&
|
||||
return 1
|
||||
fi
|
||||
|
||||
# send the signal to stop
|
||||
@ -722,7 +726,7 @@ $command $rc_flags $command_args"
|
||||
#
|
||||
eval $_doit
|
||||
_return=$?
|
||||
[ $_return -ne 0 -a -z "$rc_force" ] && return 1
|
||||
[ $_return -ne 0 ] && [ -z "$rc_force" ] && return 1
|
||||
|
||||
# wait for the command to exit,
|
||||
# and run postcmd.
|
||||
@ -747,7 +751,8 @@ $command $rc_flags $command_args"
|
||||
if [ -n "$_precmd" ]; then
|
||||
eval $_precmd
|
||||
_return=$?
|
||||
[ $_return -ne 0 -a -z "$rc_force" ] && return 1
|
||||
[ $_return -ne 0 ] && [ -z "$rc_force" ] &&
|
||||
return 1
|
||||
fi
|
||||
_doit="kill -${sig_reload:-HUP} $rc_pid"
|
||||
if [ -n "$_user" ]; then
|
||||
@ -755,7 +760,7 @@ $command $rc_flags $command_args"
|
||||
fi
|
||||
eval $_doit
|
||||
_return=$?
|
||||
[ $_return -ne 0 -a -z "$rc_force" ] && return 1
|
||||
[ $_return -ne 0 ] && [ -z "$rc_force" ] && return 1
|
||||
if [ -n "$_postcmd" ]; then
|
||||
eval $_postcmd
|
||||
_return=$?
|
||||
@ -766,7 +771,8 @@ $command $rc_flags $command_args"
|
||||
if [ -n "$_precmd" ]; then
|
||||
eval $_precmd $rc_extra_args
|
||||
_return=$?
|
||||
[ $_return -ne 0 -a -z "$rc_force" ] && return 1
|
||||
[ $_return -ne 0 ] && [ -z "$rc_force" ] &&
|
||||
return 1
|
||||
fi
|
||||
# prevent restart being called more
|
||||
# than once by any given script
|
||||
|
Loading…
Reference in New Issue
Block a user