postinst is in wzdftpd 0.8.3-6.1ubuntu4.
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 117 118 119 | #!/bin/sh
set -e
# Source debconf library.
. /usr/share/debconf/confmodule
# helper functions
replace_file () {
file=$1
if [ ! -f ${file} ] ; then
mv ${file}.wzdftpd-new ${file}
else
cp $file ${file}.wzdftpd-old
ucf --three-way --debconf-ok ${file}.wzdftpd-new $file
fi
}
do_update () {
file=$1
if diff -q ${file} ${file}.wzdftpd-new >/dev/null 2>&1; then
# Old file and new file are identical
rm -f ${file}.wzdftpd-new
else
replace_file $file
fi
}
# real config
# 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>
# * <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
#
CONF="/etc/wzdftpd/wzd.cfg"
CONF_NEW="/etc/wzdftpd/wzd.cfg.wzdftpd-new"
PID_DIR=/var/run/wzdftpd
if [ "$1" != "configure" ]; then
exit 0
fi
if [ "$1" = "configure" ]; then
# merge configuration
cp /usr/share/wzdftpd/files/wzd.cfg.sample $CONF_NEW
sed -e "s|^#pid_file[[:space:]]*=[[:space:]]*.*|pid_file = $PID_DIR/wzdftpd.pid|" $CONF_NEW >$CONF_NEW.wzdconf
chmod --reference=$CONF_NEW $CONF_NEW.wzdconf
mv $CONF_NEW.wzdconf $CONF_NEW
do_update $CONF
if [ ! -f /etc/wzdftpd/users ]; then
cp /usr/share/wzdftpd/files/users.sample /etc/wzdftpd/users
fi
fi
# the following will be used to run the server as a non-privileged user
# # extract PID_DIR from config
# if [ ! -d $PID_DIR ]; then
# mkdir $PID_DIR
# fi
if [ -d $PID_DIR ]; then
if (id ftp >/dev/null 2>/dev/null) ; then
chown ftp $PID_DIR
fi
fi
case "$1" in
configure)
ldconfig
;;
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/wzdftpd" ]; then
if [ ! -e "/etc/init/wzdftpd.conf" ]; then
update-rc.d wzdftpd defaults >/dev/null
fi
invoke-rc.d wzdftpd start || exit $?
fi
# End automatically added section
# Automatically added by dh_makeshlibs
if [ "$1" = "configure" ]; then
ldconfig
fi
# End automatically added section
# Don't wait on wzdftpd to close file handles
db_stop
exit 0
|