mirror of
https://github.com/hackacad/bastille.git
synced 2026-01-03 19:23:42 +01:00
support lowercase values in bastille.conf (issue #368)
This commit is contained in:
@@ -117,3 +117,24 @@ EOF
|
||||
EOF
|
||||
fi
|
||||
}
|
||||
|
||||
checkyesno() {
|
||||
## copied from /etc/rc.subr -- cedwards (20231125)
|
||||
## issue #368 (lowercase values should be parsed)
|
||||
## now used for all bastille_zfs_enable=YES|NO tests
|
||||
## example: if checkyesno bastille_zfs_enable; then ...
|
||||
## returns 0 for enabled; returns 1 for disabled
|
||||
eval _value=\$${1}
|
||||
case $_value in
|
||||
[Yy][Ee][Ss]|[Tt][Rr][Uu][Ee]|[Oo][Nn]|1)
|
||||
return 0
|
||||
;;
|
||||
[Nn][Oo]|[Ff][Aa][Ll][Ss][Ee]|[Oo][Ff][Ff]|0)
|
||||
return 1
|
||||
;;
|
||||
*)
|
||||
warn "\$${1} is not set properly - see rc.conf(5)."
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user