postinst is in dibbler-client 1.0.0~rc1-1.
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 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 | #!/bin/bash -e
CONFFILE_NEW=/etc/dibbler/client.conf-dpkg-new
CONFFILE=/etc/dibbler/client.conf
PATH=$PATH:.
if [ -e confmodule ]; then
. confmodule
else
. /usr/share/debconf/confmodule
fi
case "$1" in
configure)
# continue below
;;
abort-upgrade|abort-remove|abort-deconfigure)
exit 0
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 0
;;
esac
if [ -e ${CONFFILE_NEW} ]; then
rm ${CONFFILE_NEW}
fi
db_version 2.0
#db_capb backup
db_settitle dibbler-client/title
# Step 1: Do you want dibbler-client to be started?
db_get dibbler-client/start
START="$RET"
# Step 2: What interfaces should be configured?
db_get dibbler-client/interfaces
IFACES="$RET"
# Step 3: What addtional options you you want to get?
db_get dibbler-client/options
OPTS="$RET"
[ -r "${CONFFILE}" ] || {
echo Generating ${CONFFILE_NEW}... >&2
cat >${CONFFILE_NEW} <<'EOFMAGIC'
# Defaults for dibbler-client.
# installed at /etc/dibbler/client.conf by the maintainer scripts
# 8 (Debug) is most verbose. 7 (Info) is usually the best option
log-level 7
# To perform stateless (i.e. options only) configuration, uncomment
# this line below and remove any "ia" keywords from interface definitions
# stateless
EOFMAGIC
}
for i in ${IFACES}; do
echo "iface $i {" >> ${CONFFILE_NEW}
echo "# ask for address" >> ${CONFFILE_NEW}
echo " ia" >> ${CONFFILE_NEW}
echo "" >> ${CONFFILE_NEW}
# insert options
echo "# ask for options" >> ${CONFFILE_NEW}
for j in ${OPTS}; do
j=${j%,}
if [ $j == "dns" ]; then
echo " option dns-server" >> ${CONFFILE_NEW}
else
echo "# option dns-server" >> ${CONFFILE_NEW}
fi
if [ $j == "domain" ]; then
echo " option domain" >> ${CONFFILE_NEW}
else
echo "# option domain" >> ${CONFFILE_NEW}
fi
done
echo "# option ntp-server" >> ${CONFFILE_NEW}
echo "# option time-zone" >> ${CONFFILE_NEW}
echo "# option sip-server" >> ${CONFFILE_NEW}
echo "# option sip-domain" >> ${CONFFILE_NEW}
echo "# option nis-server" >> ${CONFFILE_NEW}
echo "# option nis-domain" >> ${CONFFILE_NEW}
echo "# option nis+-server" >> ${CONFFILE_NEW}
echo "# option nis+-domain" >> ${CONFFILE_NEW}
echo "}" >> ${CONFFILE_NEW}
echo "" >> ${CONFFILE_NEW}
done
# register this config
test -x /usr/bin/ucf && ucf --debconf-ok ${CONFFILE_NEW} ${CONFFILE}
db_stop
# Start service if necessary
if [ $START == "true" ]; then
# Automatically added by dh_installinit
if [ -x "/etc/init.d/dibbler-client" ] || [ -e "/etc/init/dibbler-client.conf" ]; then
if [ ! -e "/etc/init/dibbler-client.conf" ]; then
update-rc.d dibbler-client defaults >/dev/null
fi
invoke-rc.d dibbler-client start || exit $?
fi
# End automatically added section
fi
|