forked from ungleich-public/cdist
[__user] fix user delete on freebsd
This commit is contained in:
parent
226ed02c1c
commit
716d3554f3
1 changed files with 12 additions and 4 deletions
|
@ -135,11 +135,19 @@ elif [ "$state" = "absent" ]; then
|
||||||
if grep -q "^${name}:" "$__object/explorer/passwd"; then
|
if grep -q "^${name}:" "$__object/explorer/passwd"; then
|
||||||
#user exists, but state != present, so delete it
|
#user exists, but state != present, so delete it
|
||||||
if [ -f "$__object/parameter/remove-home" ]; then
|
if [ -f "$__object/parameter/remove-home" ]; then
|
||||||
printf "userdel -r '%s' >/dev/null 2>&1\\n" "${name}"
|
if [ "$os" = "freebsd" ]; then
|
||||||
echo "userdel -r" >> "$__messages_out"
|
printf "pw userdel '%s' -r >/dev/null 2>&1\\n" "${name}"
|
||||||
|
else
|
||||||
|
printf "userdel -r '%s' >/dev/null 2>&1\\n" "${name}"
|
||||||
|
fi
|
||||||
|
echo "userdel -r" >> "$__messages_out"
|
||||||
else
|
else
|
||||||
printf "userdel '%s' >/dev/null 2>&1\\n" "${name}"
|
if [ "$os" = "freebsd" ]; then
|
||||||
echo "userdel" >> "$__messages_out"
|
printf "pw userdel '%s' >/dev/null 2>&1\\n" "${name}"
|
||||||
|
else
|
||||||
|
printf "userdel '%s' >/dev/null 2>&1\\n" "${name}"
|
||||||
|
fi
|
||||||
|
echo "userdel" >> "$__messages_out"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue