This file is indexed.

postinst is in nagiosgrapher 1.7.1-3.

This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.

The actual contents of the file can be viewed below.

 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/bin/sh
# postinst script for #PACKAGE#
#
# see: dh_installdeb(1)

set -e

setperm() { 
	user="$1"
	group="$2"
	mode="$3"
	file="$4"
	shift 4
	# only do something when no setting exists
	if ! dpkg-statoverride --list "$file" >/dev/null 2>&1; then
		chown "$user":"$group" "$file"
		chmod "$mode" "$file"
	fi
	unset user
	unset group
	unset mode
	unset file
}

# summary of how this script can be called:
#        * <postinst> `configure' <most-recently-configured-version>
#        * <old-postinst> `abort-upgrade' <new version>
#        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
#          <new-version>
#        * <postinst> `abort-remove'
#        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
#          <failed-install-package> <version> `removing'
#          <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
CFGS="ngraph.ncfg ngraph.d/nmgraph.ncfg nagios3/commands.cfg"
TMPL_CFGS=" extra//check_bacula.ncfg extra//check_gsm.ncfg extra//check_hardware.ncfg extra//check_request_tracker.ncfg extra//check_snmp.ncfg extra//check_spamassassin_effectiveness.ncfg extra//check_weather.ncfg extra//check_windows.ncfg standard//check_dns.ncfg standard//check_ftp.ncfg standard//check_http.ncfg standard//check_imap.ncfg standard//check_ldap.ncfg standard//check_mailq.ncfg standard//check_mysql.ncfg standard//check_nagios.ncfg standard//check_ntp.ncfg standard//check_pop.ncfg standard//check_smtp.ncfg"

case "$1" in
    configure)
    	for cfg in $CFGS; do
		ucf /usr/share/nagiosgrapher/debian/cfg/$cfg \
			/etc/nagiosgrapher/$cfg
	done

	for tmpl in $TMPL_CFGS; do
		ucf /usr/share/nagiosgrapher/debian/cfg/ngraph.d/$tmpl \
			/etc/nagiosgrapher/ngraph.d/$tmpl
	done

	for dir in /var/lib/nagiosgrapher /var/lib/nagiosgrapher/rrd \
		/var/cache/nagiosgrapher \
		/var/log/nagiosgrapher \
		/etc/nagiosgrapher/nagios3 \
		/etc/nagiosgrapher/nagios3/serviceext; do
		test -d $dir && setperm nagios nagios 0755 $dir
	done

	for file in /var/log/nagiosgrapher/ngraph.log \
		/var/cache/nagiosgrapher/NagiosGrapher.obj; do \
		test -f $file && setperm nagios nagios 0644 $file
	done
    ;;

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

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

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

# Automatically added by dh_installinit
if [ -x "/etc/init.d/nagiosgrapher" ]; then
	if [ ! -e "/etc/init/nagiosgrapher.conf" ]; then
		update-rc.d nagiosgrapher defaults >/dev/null
	fi
	invoke-rc.d nagiosgrapher start || exit $?
fi
# End automatically added section


exit 0