redirect stdout+stderr of userdel

If no mail-spoolfile exists for the user the error reporting was
visible in the cdist-run.
This commit is contained in:
tom 2018-10-11 16:01:50 +02:00
parent a1bf381370
commit c995d08ce2

View file

@ -135,10 +135,10 @@ elif [ "$state" = "absent" ]; then
if grep -q "^${name}:" "$__object/explorer/passwd"; then
#user exists, but state != present, so delete it
if [ -f "$__object/parameter/remove-home" ]; then
echo userdel -r "${name}"
printf "userdel -r %s >/dev/null 2>&1\n" "${name}"
echo "userdel -r" >> "$__messages_out"
else
echo userdel "${name}"
printf "userdel %s >/dev/null 2>&1\n" "${name}"
echo "userdel" >> "$__messages_out"
fi
fi