File: postinst

package info (click to toggle)
cacti-spine 0.8.7e-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 3,900 kB
  • ctags: 534
  • sloc: ansic: 4,564; sh: 882; makefile: 70
file content (27 lines) | stat: -rw-r--r-- 632 bytes parent folder | download
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
#!/bin/sh

set -e

generate_config() {
	confdbc=/usr/share/doc/cacti-spine/spine.conf.dbconfig
	confsrc=/usr/share/doc/cacti-spine/spine.conf.sample
	if [ -f "/etc/dbconfig-common/cacti.conf" ]; then
		dbconfig-generate-include -U -f template -o "template_infile=$confdbc" /etc/dbconfig-common/cacti.conf /etc/cacti/spine.conf
	else
		ucf $confsrc /etc/cacti/spine.conf
	fi
  ucfr cacti-spine /etc/cacti/spine.conf
	chown root:www-data /etc/cacti/spine.conf
	chmod 640 /etc/cacti/spine.conf
}

case "$1" in
"configure"|"reconfigure"|"upgrade")
	. /usr/share/debconf/confmodule
	db_version 2.0

	generate_config
;;
esac

#DEBHELPER#