This file is indexed.

postinst is in ifplugd 0.28-19ubuntu1.

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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
#!/bin/sh

set -e
 
# source debconf library
. /usr/share/debconf/confmodule
 
CONFIGFILE=/etc/ifplugd/ifplugd.conf
CONFIGTMP=${CONFIGFILE}.tmp

DEFAULTFILE=/etc/default/ifplugd
DEFAULTTMP=${DEFAULTFILE}.tmp

write_db_conf (){

	rm -f ${CONFIGTMP}

	echo "# this file is deprecated - use /etc/default/ifplugd." >> ${CONFIGTMP}
 
	mv ${CONFIGTMP} ${CONFIGFILE}
}

write_default (){

	rm -f ${DEFAULTTMP}

	(
	    echo "# This file may be changed either manually or by running dpkg-reconfigure."
	    echo "#"
	    echo "# N.B.: dpkg-reconfigure deletes everything from this file except for"
	    echo "# the assignments to variables INTERFACES, HOTPLUG_INTERFACES, ARGS and"
	    echo "# SUSPEND_ACTION.  When run it uses the current values of those variables"
	    echo "# as their default values, thus preserving the administrator's changes."
            echo "#"
            echo "# This file is sourced by both the init script /etc/init.d/ifplugd and"
            echo "# the udev script /lib/udev/ifplugd.agent to give default values."
            echo "# The init script starts ifplugd for all interfaces listed in"
            echo "# INTERFACES, and the udev script starts ifplugd for all interfaces"
            echo "# listed in HOTPLUG_INTERFACES. The special value "all" starts one"
            echo "# ifplugd for all interfaces being present."
	) >> $DEFAULTTMP

	db_get ifplugd/interfaces || true
	echo "INTERFACES=\"$RET\"" >> $DEFAULTTMP
	db_get ifplugd/hotplug_interfaces || true
	echo "HOTPLUG_INTERFACES=\"$RET\"" >> $DEFAULTTMP
	db_get ifplugd/args || true
	echo "ARGS=\"$RET\"" >> $DEFAULTTMP
	db_get ifplugd/suspend_action || true
	echo "SUSPEND_ACTION=\"$RET\"" >> $DEFAULTTMP
 
	mv ${DEFAULTTMP} ${DEFAULTFILE}
}

INTERFACES_BEFORE=""
INTERFACES_AFTER=""
INTERFACES_START=""
INTERFACES_STOP=""
INTERFACES_RESTART=""

search_interfaces () {
	searchifc=$1
	shift

	for i in $@; do
		if [ "$i" = "$searchifc" ]; then
			return 0
		fi
	done

	return 1
}

ifplugd_initscript () {
	action=$1
	shift

	if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
		invoke-rc.d ifplugd $action $@
	else
		/etc/init.d/ifplugd $action $@
	fi
}

case "$1" in
    configure)
 		if [ -s "$DEFAULTFILE" ] ; then
			INTERFACES=""
			HOTPLUG_INTERFACES=""
			. $DEFAULTFILE
			INTERFACES_BEFORE="$INTERFACES $HOTPLUG_INTERFACES"
		fi

		write_db_conf
		write_default

		if [ -s "$DEFAULTFILE" ] ; then
			INTERFACES=""
			HOTPLUG_INTERFACES=""
			. $DEFAULTFILE
			INTERFACES_AFTER="$INTERFACES $HOTPLUG_INTERFACES"
		fi

		for IF in $INTERFACES_BEFORE ; do
			if search_interfaces $IF $INTERFACES_AFTER ; then
				INTERFACES_RESTART="$INTERFACES_RESTART $IF"
			else
				INTERFACES_STOP="$INTERFACES_STOP $IF"
			fi
		done

		for IF in $INTERFACES_AFTER ; do
			if search_interfaces $IF $INTERFACES_BEFORE ; then
				: # already added to INTERFACES_RESTART
			else
				INTERFACES_START="$INTERFACES_START $IF"
			fi
		done

		if [ -x "/etc/init.d/ifplugd" ]; then
			update-rc.d ifplugd defaults >/dev/null
			if [ "$INTERFACES_STOP" ]; then
				ifplugd_initscript stop $INTERFACES_STOP
			fi
			if [ "$INTERFACES_RESTART" ]; then
				ifplugd_initscript restart $INTERFACES_RESTART
			fi
			if [ "$INTERFACES_START" ]; then
				ifplugd_initscript start $INTERFACES_START
			fi
		fi

		if [ ! "$2" ] || [ "$2" = "<unknown>" ] ; then
			# Fresh install
			for F in /etc/apm/suspend.d/20ifplugd \
				    /etc/apm/resume.d/80ifplugd /etc/apm/other.d/50ifplugd ; do
				[ -e $F ] && mv -f $F ${F}.dpkg-old
				ln -nsf ../scripts.d/ifplugd $F
			done
		fi
        ;;
 
    abort-upgrade|abort-remove|abort-deconfigure)
        ;;
esac

db_stop

# Automatically added by dh_installudev
if [ "$1" = configure ]; then
	if [ -e "/etc/udev/rules.d/z60_ifplugd.rules" ]; then
		echo "Preserving user changes to /etc/udev/rules.d/40-ifplugd.rules ..."
		if [ -e "/etc/udev/rules.d/40-ifplugd.rules" ]; then
			mv -f "/etc/udev/rules.d/40-ifplugd.rules" "/etc/udev/rules.d/40-ifplugd.rules.dpkg-new"
		fi
		mv -f "/etc/udev/rules.d/z60_ifplugd.rules" "/etc/udev/rules.d/40-ifplugd.rules"
	fi
fi
# End automatically added section