summaryrefslogtreecommitdiffstats
path: root/debian/netdata-apache2.postinst
blob: 565006d0cbd35ba483bdf0a44125f2fbfa4e2b8b (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
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/bin/sh

set -e

case "${1}" in
	configure)
		if [ -x "$(which a2enmod)" ]
		then
			a2enmod proxy proxy_http rewrite
		fi

		if [ -x "$(which a2enconf)" ]
		then
			a2enconf netdata
		fi

		if [ -x "/etc/init.d/apache2" ]; then
                if [ -n "$2" ]; then
                        _dh_action=restart
                else
                        _dh_action=start
                fi
                invoke-rc.d apache2 $_dh_action || true
        fi

		;;

	abort-upgrade|abort-remove|abort-deconfigure)
		;;

	*)
		echo "postinst called with unknown argument \`${1}'" >&2
		exit 1
		;;
esac

#DEBHELPER#

exit 0