add some NetBSD support in __user_groups

remotes/origin/4.0
Jonathan A. Kollasch 9 years ago
parent 68370db5c3
commit 90fe1bf6c9
  1. 2
      cdist/conf/type/__user_groups/explorer/group
  2. 7
      cdist/conf/type/__user_groups/explorer/oldusermod
  3. 8
      cdist/conf/type/__user_groups/gencode-remote

@ -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/>.
#
os="$($__explorer/os)"
if [ "$os" = "netbsd" ]; then
echo netbsd
exit
fi
usermod --help | grep -q -- '-A group' && echo true || echo false

@ -21,8 +21,14 @@
user="$(cat "$__object/parameter/user" 2>/dev/null || echo "$__object_id")"
state_should="$(cat "$__object/parameter/state")"
oldusermod="$(cat "$__object/explorer/oldusermod")"
os=$(cat "$__global/explorer/os")
if [ "$oldusermod" = "true" ]; then
if [ "$os" = "netbsd" ]; 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

Loading…
Cancel
Save