31 lines
641 B
Bash
Executable File
31 lines
641 B
Bash
Executable File
#!/bin/sh
|
|
set -e
|
|
|
|
case "$1" in
|
|
remove)
|
|
# Remove logs and data
|
|
rm -rf /var/log/elasticsearch /var/lib/elasticsearch
|
|
;;
|
|
|
|
purge)
|
|
# Remove service
|
|
update-rc.d elasticsearch remove >/dev/null || true
|
|
|
|
# Remove logs and data
|
|
rm -rf /var/log/elasticsearch /var/lib/elasticsearch
|
|
|
|
# Remove user/group
|
|
deluser elasticsearch || true
|
|
delgroup elasticsearch || true
|
|
;;
|
|
|
|
upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
|
|
# Nothing to do here
|
|
;;
|
|
|
|
*)
|
|
echo "$0 called with unknown argument \`$1'" >&2
|
|
exit 1
|
|
;;
|
|
esac
|