diff options
author | Hilko Bengen <bengen@debian.org> | 2014-06-07 12:02:12 +0200 |
---|---|---|
committer | Hilko Bengen <bengen@debian.org> | 2014-06-07 12:02:12 +0200 |
commit | d5ed89b946297270ec28abf44bef2371a06f1f4f (patch) | |
tree | ce2d945e4dde69af90bd9905a70d8d27f4936776 /src/deb/control/prerm | |
download | elasticsearch-d5ed89b946297270ec28abf44bef2371a06f1f4f.tar.gz |
Imported Upstream version 1.0.3upstream/1.0.3
Diffstat (limited to 'src/deb/control/prerm')
-rwxr-xr-x | src/deb/control/prerm | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/deb/control/prerm b/src/deb/control/prerm new file mode 100755 index 0000000..fb3c9eb --- /dev/null +++ b/src/deb/control/prerm @@ -0,0 +1,26 @@ +#!/bin/sh +set -e + +[ -f /etc/default/elasticsearch ] && . /etc/default/elasticsearch + +stopElasticsearch() { + if [ -x "/etc/init.d/elasticsearch" ]; then + if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then + invoke-rc.d elasticsearch stop || true + else + /etc/init.d/elasticsearch stop || true + fi + fi +} + +case "$1" in + upgrade) + if [ "$RESTART_ON_UPGRADE" = "true" ] ; then + stopElasticsearch + fi + ;; + remove) + stopElasticsearch + ;; +esac + |