[build] Cleanup postrm

This commit is contained in:
Jonathan Budzenski 2016-05-10 13:16:51 -05:00
parent f9033a1c6e
commit bab73b8971

View file

@ -9,10 +9,34 @@ user_remove() {
userdel "$1"
}
REMOVE_USER=false
case $1 in
purge|0)
if user_check "<%= user %>" ; then
user_remove "<%= user %>"
fi
;;
# Debian
purge)
REMOVE_USER=true
;;
remove|failed-upgrade|abort-install|abort-upgrade|disappear|upgrade|disappear)
;;
# Red Hat
0)
REMOVE_USER=true
;;
1)
;;
*)
echo "post remove script called with unknown argument \`$1'" >&2
exit 1
;;
esac
if [ "$REMOVE_USER" = "true" ]; then
if user_check "<%= user %>" ; then
user_remove "<%= user %>"
fi
fi