summaryrefslogtreecommitdiff
path: root/src/deb/control/prerm
blob: fb3c9eb2ce46b92e1e05db08c91a1b01d60df335 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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