Add check_namevarlist() to check if ${name}_var is reserved in rc.subr or not.
This commit is contained in:
parent
dbd1414ddc
commit
571b26027e
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=243184
17
etc/rc.subr
17
etc/rc.subr
@ -1724,6 +1724,23 @@ check_kern_features()
|
|||||||
fi
|
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
|
# _echoonce var msg mode
|
||||||
# mode=0: Echo $msg if ${$var} is empty.
|
# mode=0: Echo $msg if ${$var} is empty.
|
||||||
# After doing echo, a string is set to ${$var}.
|
# After doing echo, a string is set to ${$var}.
|
||||||
|
Loading…
Reference in New Issue
Block a user