This file is indexed.

postinst is in isc-dhcp-relay 4.2.4-7ubuntu12.

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
#!/bin/sh
#
#

set -e

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

# Handle debconf
. /usr/share/debconf/confmodule

# We generate several files during the postinst, and we don't want
#	them to be readable only by root.
umask 022

INITCONFFILE=/etc/default/isc-dhcp-relay

# Generate configuration file if it does not exist, using default values.
[ -r "${INITCONFFILE}" ] || {
	echo Generating ${INITCONFFILE}... >&2
	cat >${INITCONFFILE} <<'EOFMAGICNUMBER1234'
# Defaults for isc-dhcp-relay initscript
# sourced by /etc/init.d/isc-dhcp-relay
# installed at /etc/default/isc-dhcp-relay by the maintainer scripts

#
# This is a POSIX shell fragment
#

# What servers should the DHCP relay forward requests to?
SERVERS="172.16.0.10"

# On what interfaces should the DHCP relay (dhrelay) serve DHCP requests?
INTERFACES="eth0"

# Additional options that are passed to the DHCP relay daemon?
OPTIONS=""
EOFMAGICNUMBER1234
}

# ------------------------- Debconf questions start ---------------------

db_get isc-dhcp-relay/interfaces || true
INTERFACES="${RET}"

TMPFILE=`mktemp -q /tmp/dhcp.config.XXXXXX`
sed -e "s/^[[:space:]]*INTERFACES[[:space:]]*=.*/INTERFACES=\"${INTERFACES}\"/" \
	<${INITCONFFILE} >${TMPFILE}
cp ${TMPFILE} ${INITCONFFILE}
rm ${TMPFILE}

db_get isc-dhcp-relay/servers || true
SERVERS="${RET}"

TMPFILE=`mktemp -q /tmp/dhcp.config.XXXXXX`
sed -e "s/^[[:space:]]*SERVERS[[:space:]]*=.*/SERVERS=\"${SERVERS}\"/" \
        <${INITCONFFILE} >${TMPFILE}
cp ${TMPFILE} ${INITCONFFILE}
rm ${TMPFILE}

db_get isc-dhcp-relay/options || true
OPTIONS="${RET}"

TMPFILE=`mktemp -q /tmp/dhcp.config.XXXXXX`
sed -e "s/^[[:space:]]*OPTIONS[[:space:]]*=.*/OPTIONS=\"${OPTIONS}\"/" \
        <${INITCONFFILE} >${TMPFILE}
cp ${TMPFILE} ${INITCONFFILE}
rm ${TMPFILE}

# ------------------------- Debconf questions end ---------------------

db_stop

# Automatically added by dh_installinit
if [ -x "/etc/init.d/isc-dhcp-relay" ] || [ -e "/etc/init/isc-dhcp-relay.conf" ]; then
	if [ ! -e "/etc/init/isc-dhcp-relay.conf" ]; then
		update-rc.d isc-dhcp-relay defaults >/dev/null
	fi
	invoke-rc.d isc-dhcp-relay start || exit $?
fi
# End automatically added section
# Automatically added by dh_installinit
update-rc.d -f isc-dhcp-relay remove >/dev/null || exit $?
# End automatically added section
# Automatically added by dh_installinit
if [ -x "/etc/init.d/isc-dhcp-relay6" ] || [ -e "/etc/init/isc-dhcp-relay6.conf" ]; then
	if [ ! -e "/etc/init/isc-dhcp-relay6.conf" ]; then
		update-rc.d isc-dhcp-relay6 defaults >/dev/null
	fi
	invoke-rc.d isc-dhcp-relay6 start || exit $?
fi
# End automatically added section
# Automatically added by dh_installinit
update-rc.d -f isc-dhcp-relay6 remove >/dev/null || exit $?
# End automatically added section


exit 0