#!/bin/sh -e if [ "$1" = "configure" ] && [ -e /usr/share/debconf/confmodule ]; then . /usr/share/debconf/confmodule # Get answers to questions db_get ifupdown/convert-interfaces; ATTEMPT_CONVERSION="$RET" elif [ "$1" = "configure" ] && dpkg --compare-versions "$2" le "0.6.2pr-3" then echo cat < interfaces.dpkg-new 2>/dev/null then echo " succeeded." mv interfaces interfaces.dpkg-old mv interfaces.dpkg-new interfaces echo "Old interfaces file saved as interfaces.dpkg-old." else echo " failed." echo echo "If you wish to reattempt the conversion you may run" echo " cat /etc/network/interfaces |" echo " /usr/share/ifupdown/upgrade-from-0.5.x.pl" echo if [ ! -e /usr/share/debconf/confmodule ]; then echo -n "Press enter to continue:" read blah fi # debconf users can't be prompted. stupid program. fi ) fi if [ "$1" = configure -a -e /var/run/ifupdown.state -a \ ! -e /etc/network/ifstate ] then mv /var/run/ifupdown.state /etc/network/ifstate fi if [ "$1" = "configure" ] \ && dpkg --compare-versions "$2" le "0.6.4-4.1" \ && [ -f /etc/network/ifstate ] \ && [ -x /sbin/dhclient ] then # for every[1] active ifupdown-controlled dhclient interface, copy # /var/run/dhclient.pid, so that the new ifdown is able to kill # dhclient. # # [1] old version has a bug with more than one DHCP iface anyway, # just we don't know which one made it if there are several. sed -e 's/^.*=//' /etc/network/ifstate | while read iface do # handle \-continued lines sed -e '/^[[:space:]]*#/b;:g /\\$/{N;s/\\\n//;bg;}' /etc/network/interfaces |\ if grep -e "^[[:space:]]*iface[[:space:]]*\\b${iface}\\b[[:space:]]*.*\\bdhcp\\b.*" >/dev/null 2>&1 \ && [ -f "/var/run/dhclient.pid" ] \ && [ ! -f "/var/run/dhclient.${iface}.pid" ] then # copy original file. If dhclient was started # manually, one can still use dhclient.pid, if started # by ifupdown, the new ifupdown can take it down with # dhclient.${iface}.pid. Obsolete files are removed during # next boot (bootmisc.sh). cp /var/run/dhclient.pid "/var/run/dhclient.${iface}.pid" fi done fi update-rc.d ifupdown start 39 S . >/dev/null ##DEBHELPER##