Move the check for enabled knobs further down in run_rc_command() so
that bogus commands cause usage information to be printed instead of diagnostics about enabling the knob.
This commit is contained in:
parent
8e9a8a6c78
commit
8717ddefb6
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=179870
34
etc/rc.subr
34
etc/rc.subr
@ -612,29 +612,29 @@ run_rc_command()
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# if ${rcvar} is set, and $1 is not
|
|
||||||
# "rcvar", then run
|
|
||||||
# checkyesno ${rcvar}
|
|
||||||
# and return if that failed
|
|
||||||
#
|
|
||||||
if [ -n "${rcvar}" -a "$rc_arg" != "rcvar" ]; then
|
|
||||||
if ! checkyesno ${rcvar}; then
|
|
||||||
if [ -n "${rc_quiet}" ]; then
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
echo -n "Cannot '${rc_arg}' $name. Set ${rcvar} to "
|
|
||||||
echo -n "YES in /etc/rc.conf or use 'one${rc_arg}' "
|
|
||||||
echo "instead of '${rc_arg}'."
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
eval $_pidcmd # determine the pid if necessary
|
eval $_pidcmd # determine the pid if necessary
|
||||||
|
|
||||||
for _elem in $_keywords; do
|
for _elem in $_keywords; do
|
||||||
if [ "$_elem" != "$rc_arg" ]; then
|
if [ "$_elem" != "$rc_arg" ]; then
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
# if ${rcvar} is set, and $1 is not
|
||||||
|
# "rcvar", then run
|
||||||
|
# checkyesno ${rcvar}
|
||||||
|
# and return if that failed
|
||||||
|
#
|
||||||
|
if [ -n "${rcvar}" -a "$rc_arg" != "rcvar" ]; then
|
||||||
|
if ! checkyesno ${rcvar}; then
|
||||||
|
if [ -n "${rc_quiet}" ]; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
echo -n "Cannot '${rc_arg}' $name. Set ${rcvar} to "
|
||||||
|
echo -n "YES in /etc/rc.conf or use 'one${rc_arg}' "
|
||||||
|
echo "instead of '${rc_arg}'."
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# if there's a custom ${XXX_cmd},
|
# if there's a custom ${XXX_cmd},
|
||||||
# run that instead of the default
|
# run that instead of the default
|
||||||
#
|
#
|
||||||
|
Loading…
Reference in New Issue
Block a user