postinst is in ez-ipupdate 3.0.11b8-13.4.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 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 | #! /bin/sh
# postinst script for ez-ipupdate
#
# see: dh_installdeb(1)
set -e
# Load the debconf library
. /usr/share/debconf/confmodule
# 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
#
# quoting from the policy:
# Any necessary prompting should almost always be confined to the
# post-installation script, and should be protected with a conditional
# so that unnecessary prompting doesn't happen if a package's
# installation fails and the `postinst' is called with `abort-upgrade',
# `abort-remove' or `abort-deconfigure'.
case "$1" in
configure)
# Create the user if it doesn't exist
if ! id ez-ipupd 2>/dev/null 1>&2 ; then
adduser --system --home /var/cache/ez-ipupdate \
--shell /bin/false --gecos "Dynamic DNS client" \
--disabled-password --disabled-login ez-ipupd
fi
# Create the default cache file
touch /var/cache/ez-ipupdate/default-cache
chown ez-ipupd /var/cache/ez-ipupdate/default-cache
# Remove spurious cache file from the 3.0.11b8-2 broken package
rm -f /var/cache/ez-ipupdate/cache-default
# Create the default config file (maybe)
db_get ez-ipupdate/service_type
if [ "$RET" != "configure manually" ] ; then
service="$RET"
conf="/etc/ez-ipupdate/default.conf"
newconf="$conf.dpkg-new"
# Grab answers from debconf
db_get ez-ipupdate/ppp
ppp="$RET"
db_get ez-ipupdate/username
username="$RET"
db_get ez-ipupdate/password
password="$RET"
db_get ez-ipupdate/hostname
hostname="$RET"
db_get ez-ipupdate/interface
interface="$RET"
echo "#!/usr/sbin/ez-ipupdate -c" > "$newconf"
cat >> "$newconf" << EOF
###
### Default ez-ipupdate configuration file - EDIT WITH CARE
### Use \`dpkg-reconfigure ez-ipupdate' to update the debconf-generated lines.
###
### The following lines were generated by debconf
service-type=$service
EOF
db_get ez-ipupdate/server || RET=""
if [ -n "$RET" ]; then
echo "server=$RET" >> "$newconf"
else
echo "#server=(default)" >> "$newconf"
fi
cat >> "$newconf" << EOF
user=$username:$password
host=$hostname
interface=$interface
EOF
db_get ez-ipupdate/dns_wildcard || RET="false"
if [ "$RET" = "true" ]; then
echo "wildcard" >> "$newconf"
else
echo "#wildcard" >> "$newconf"
fi
db_get ez-ipupdate/dns_mx || RET=""
if [ -n "$RET" ]; then
echo "mx=$RET" >> "$newconf"
else
echo "#mx=(none)" >> "$newconf"
fi
cat >> "$newconf" << EOF
run-as-user=ez-ipupd
cache-file=/var/cache/ez-ipupdate/default-cache
EOF
if [ "$ppp" = "true" ]; then
echo "#daemon" >> "$newconf"
else
echo "daemon" >> "$newconf"
fi
echo >> "$newconf"
if grep -q '^### Changes below this' "$conf" >/dev/null 2>&1; then
sed -ne '/^### Changes below this/,$p' < "$conf" >> "$newconf"
else
cat >> "$newconf" << EOF
### Changes below this line will be preserved on upgrades.
EOF
fi
# Fix the file permissions
chmod 700 "$newconf"
rm -f "$conf" && mv "$newconf" "$conf"
# Remove that old file, from broken 3.0.11b8-3 package
rm -f "$conf.new"
fi
;;
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/ez-ipupdate" ]; then
update-rc.d ez-ipupdate defaults >/dev/null
fi
if [ -x "/etc/init.d/ez-ipupdate" ] || [ -e "/etc/init/ez-ipupdate.conf" ]; then
invoke-rc.d ez-ipupdate start || exit $?
fi
# End automatically added section
# ez-ipupdate is a bit misbehaved.
db_stop
exit 0
|