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:
Mike Makonnen 2008-06-19 06:11:34 +00:00
parent 8e9a8a6c78
commit 8717ddefb6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=179870

View File

@ -612,29 +612,29 @@ run_rc_command()
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
for _elem in $_keywords; do
if [ "$_elem" != "$rc_arg" ]; then
continue
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},
# run that instead of the default
#