conditional use of deluser and delgroup

This commit is contained in:
Jan Wagner 2008-04-14 09:12:19 +00:00
parent f31cd74f74
commit 863763f6a0

16
debian/postrm vendored
View file

@ -27,14 +27,14 @@ case "$1" in
if USERID=`getent passwd $NUSER | cut -f 3 -d ':'`; then
if [ -n "$USERID" ]; then
if [ "$FIST_SYSTEM_UID" -le "$USERID" ] && \
[ "$USERID" -le "$LAST_SYSTEM_UID" ]; then
deluser --quiet $NUSER || true
# And then remove the group
GROUPID=`getent group $NGROUP | cut -f 3 -d ':'`
if [ -n "$GROUPID" ] ; then
delgroup --quiet $NGROUP || true
fi
[ "$USERID" -le "$LAST_SYSTEM_UID" ] && \
[ -x /usr/sbin/deluser ]; then
deluser --quiet $NUSER || true
# And then remove the group
GROUPID=`getent group $NGROUP | cut -f 3 -d ':'`
if [ -n "$GROUPID" ] && [ -x /usr/sbin/delgroup ] ; then
delgroup --quiet $NGROUP || true
fi
fi
fi
fi