| 1 |
#!/bin/sh |
| 2 |
|
| 3 |
set -e |
| 4 |
|
| 5 |
. /usr/share/debconf/confmodule |
| 6 |
. /usr/share/dbconfig-common/dpkg/postinst |
| 7 |
|
| 8 |
#dbc_debug='1' |
| 9 |
dbc_generate_include='template:/etc/icinga2/features-available/ido-pgsql.conf' |
| 10 |
dbc_generate_include_owner='nagios:nagios' |
| 11 |
dbc_generate_include_args='--ucf -o template_infile=/usr/share/icinga2/tmpl/ido-pgsql.conf-sample' |
| 12 |
dbc_go icinga2-ido-pgsql $@ |
| 13 |
|
| 14 |
|
| 15 |
if [ "$1" = configure ]; then |
| 16 |
|
| 17 |
# get values from debconf db |
| 18 |
db_get icinga2-ido-pgsql/enable |
| 19 |
|
| 20 |
if [ "$RET" = "false" ]; then |
| 21 |
if [ -L /etc/icinga2/features-enabled/ido-pgsql.conf ] |
| 22 |
then |
| 23 |
echo "disable ido pgsql feature" |
| 24 |
icinga2 feature disable ido-pgsql |
| 25 |
echo "reloading icinga2" |
| 26 |
[ -x $(which invoke-rc.d) ] && invoke-rc.d icinga2 reload |
| 27 |
fi |
| 28 |
else |
| 29 |
if [ ! -L /etc/icinga2/features-enabled/ido-pgsql.conf ] |
| 30 |
then |
| 31 |
echo "enable ido pgsql feature" |
| 32 |
icinga2 feature enable ido-pgsql |
| 33 |
echo "reloading icinga2" |
| 34 |
[ -x $(which invoke-rc.d) ] && invoke-rc.d icinga2 reload |
| 35 |
|
| 36 |
fi |
| 37 |
fi |
| 38 |
fi |
| 39 |
|
| 40 |
#DEBHELPER# |
| 41 |
db_stop |
| 42 |
|
| 43 |
|