d/postfwd.postrm: detect existens of command by which and not 'test -x'
This commit is contained in:
parent
ac0ac42ae2
commit
e438455e0f
9
debian/postfwd.postrm
vendored
9
debian/postfwd.postrm
vendored
|
@ -27,18 +27,21 @@ 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" ] && \
|
||||
[ -x /usr/sbin/deluser ]; then
|
||||
[ "$USERID" -le "$LAST_SYSTEM_UID" ]; then
|
||||
if which deluser > /dev/null; 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
|
||||
if [ -n "$GROUPID" ]; then
|
||||
if which delgroup > /dev/null; then
|
||||
delgroup --quiet $NGROUP || true
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
|
||||
remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
|
||||
|
|
Loading…
Reference in a new issue