@ -25,7 +25,7 @@ destination="/$__object_id"
os=$("$__explorer/os")
case "$os" in
"freebsd"|"openbsd")
"freebsd"|"netbsd"|"openbsd")
# FIXME: should be something like this based on man page, but can not test
stat -f "type: %ST
owner: %Du %Su
@ -109,6 +109,12 @@ for param in $(ls "$__object/parameter/"); do
# remove trailing ,
printf ' ,"retry_join": [%s]\n' "${retry_join%*,}"
;;
retry-join-wan)
# join multiple parameters into json array over wan
retry_join_wan="$(awk '{printf "\""$1"\","}' "$__object/parameter/retry-join-wan")"
printf ' ,"retry_join_wan": [%s]\n' "${retry_join_wan%*,}"
bootstrap-expect)
# integer key=value parameters
key="$(echo "$param" | tr '-' '_')"
@ -17,3 +17,4 @@ key-file-source
node-name
user
state
advertise-wan
@ -1 +1,2 @@
retry-join
retry-join-wan
@ -24,9 +24,11 @@
name=$__object_id
os="$($__explorer/os)"
if [ "$os" = "freebsd" ]; then
echo "FreeBSD does not have getent gshadow"
exit 0
fi
"freebsd"|"netbsd")
echo "$os does not have getent gshadow"
esac
getent gshadow "$name" || true
@ -34,7 +34,7 @@ case "$os" in
__package timezone
export require="__package/timezone"
freebsd)
freebsd|netbsd)
# whitelist
:
@ -20,4 +20,4 @@
user="$(cat "$__object/parameter/user" 2>/dev/null || echo "$__object_id")"
(id --groups --name "$user" | tr ' ' '\n' | sort) 2>/dev/null || true
(id -G -n "$user" | tr ' ' '\n' | sort) 2>/dev/null || true
@ -18,4 +18,11 @@
# along with cdist. If not, see <http://www.gnu.org/licenses/>.
#
if [ "$os" = "netbsd" ]; then
echo netbsd
exit
usermod --help | grep -q -- '-A group' && echo true || echo false
@ -21,8 +21,14 @@
state_should="$(cat "$__object/parameter/state")"
oldusermod="$(cat "$__object/explorer/oldusermod")"
os=$(cat "$__global/explorer/os")
if [ "$oldusermod" = "true" ]; then
# NetBSD does not have a command to remove a user from a group
oldusermod="true"
addparam="-G"
delparam=";;#"
elif [ "$oldusermod" = "true" ]; then
addparam="-A"
delparam="-R"
else