aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiroki Sato <hrs@FreeBSD.org>2012-11-17 18:11:10 +0000
committerHiroki Sato <hrs@FreeBSD.org>2012-11-17 18:11:10 +0000
commit571b26027ea635673ec2e790bb64d29ccc86e751 (patch)
tree5c8fa5076197b5e5f3567da52dd2d186c31650e6
parentdbd1414ddc28296dac66461d6a71f827bfdebd03 (diff)
downloadsrc-571b26027ea635673ec2e790bb64d29ccc86e751.tar.gz
src-571b26027ea635673ec2e790bb64d29ccc86e751.zip
Add check_namevarlist() to check if ${name}_var is reserved in rc.subr or not.
Notes
Notes: svn path=/head/; revision=243184
-rw-r--r--etc/rc.subr17
1 files changed, 17 insertions, 0 deletions
diff --git a/etc/rc.subr b/etc/rc.subr
index 5c9409744ec6..bec5e7ec2f52 100644
--- a/etc/rc.subr
+++ b/etc/rc.subr
@@ -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}.