mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[build] Cleanup postrm
This commit is contained in:
parent
f9033a1c6e
commit
bab73b8971
1 changed files with 29 additions and 5 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue