postinst is in tango-common 8.1.2c+dfsg-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 | #!/bin/sh
CONFIGFILE=/etc/tangorc
set -e
. /usr/share/debconf/confmodule
# Generate config file, if it doesn't exist.
# An alternative is to copy in a template
# file from elsewhere.
if [ ! -e $CONFIGFILE ]; then
echo "# Config file for my package" > $CONFIGFILE
echo "TANGO_HOST=" >> $CONFIGFILE
fi
# Substitute in the values from the debconf db.
# There are obvious optimizations possible here.
# The cp before the sed ensures we do not mess up
# the config file's ownership and permissions.
db_get tango-common/tango-host
TANGO_HOST=$RET
cp -a -f $CONFIGFILE $CONFIGFILE.tmp
# If the admin deleted or commented some variables but then set
# them via debconf, (re-)add them to the conffile.
test -z "$TANGO_HOST" || grep -Eq '^ *TANGO_HOST=' $CONFIGFILE || \
echo "TANGO_HOST=" >> $CONFIGFILE
sed -e "s/^ *TANGO_HOST=.*/TANGO_HOST=$TANGO_HOST/" \
< $CONFIGFILE > $CONFIGFILE.tmp
mv -f $CONFIGFILE.tmp $CONFIGFILE
|