Add check_namevarlist() to check if ${name}_var is reserved in rc.subr or not.

This commit is contained in:
Hiroki Sato 2012-11-17 18:11:10 +00:00
parent dbd1414ddc
commit 571b26027e

View File

@ -1724,6 +1724,23 @@ check_kern_features()
fi
}
# check_namevarlist var
# Return "0" if ${name}_var is reserved in rc.subr.
_rc_namevarlist="program chroot chdir flags fib nice user group groups"
check_namevarlist()
{
local _v
for _v in $_rc_namevarlist; do
case $1 in
$_v) return 0 ;;
esac
done
return 1
}
# _echoonce var msg mode
# mode=0: Echo $msg if ${$var} is empty.
# After doing echo, a string is set to ${$var}.