I just see there already was a patch and the attached patch is extremely 
similar, but also contains some minor code cleanup.

It applies on top of the patches for #455366 and #475032.

Cheers,
FJP

commit 43dab8eabc2adafaf40fca1f74b82c870d9d0094
Author: Frans Pop <[EMAIL PROTECTED]>
Date:   Tue Apr 8 16:40:50 2008 +0200

    Use 'ip' instead of 'ifconfig' as the latter is no longer included in busybox

diff --git a/debian/changelog b/debian/changelog
index cd409c4..df79227 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,8 +4,10 @@ ppp (2.4.4rel-9.1) UNRELEASED; urgency=low
   * ppp-udeb: allow for preseeding of the netcfg/get_hostname template.
     Closes: #455366.
   * ppp-udeb: also ask for a domain name to be used in /etc/hosts.
+  * ppp-udeb: switch from using 'ifconfig' to 'ip' because the former is no
+    longer included in busybox-udeb. Closes: #451446.
 
- -- Frans Pop <[EMAIL PROTECTED]>  Tue, 08 Apr 2008 16:24:35 +0200
+ -- Frans Pop <[EMAIL PROTECTED]>  Tue, 08 Apr 2008 16:40:55 +0200
 
 ppp (2.4.4rel-9) unstable; urgency=low
 
diff --git a/debian/ppp-udeb.postinst b/debian/ppp-udeb.postinst
index 1daa9ba..5e02bc5 100644
--- a/debian/ppp-udeb.postinst
+++ b/debian/ppp-udeb.postinst
@@ -15,16 +15,12 @@ fail() {
 	logger -t FAIL:ppp-udeb $*
 }
 
-not_already_up() {
-	return $(ifconfig | egrep "^$1[[:space:]]" | wc -l)
-}
-
 ppp_concentrator_on() {
 	db_subst ppp/detect_progress IFACE "${1}" || true
-	if not_already_up $1; then
+	if [ -z "$(ip link show $1 up)" ]; then
 		log "$1 was not configured. ppp-udeb will bring it up"
 		PPPUP=yes
-		ifconfig $1 up
+		ip link set $1 up
 	else
 		log "$1 was already up"
 		PPPUP=no
@@ -34,7 +30,9 @@ ppp_concentrator_on() {
 	rm -f /tmp/probe-finished /tmp/ppp-errors
 	db_progress START 0 $TOTWAIT ppp/detect_progress
 	for P in " " "-U" ; do
-		( R=$(/usr/sbin/pppoe-discovery -A $P -I $1 2>/tmp/ppp-errors | grep AC | wc -l); echo $R > /tmp/probe-finished ) &
+		( R=$(/usr/sbin/pppoe-discovery -A $P -I $1 2>/tmp/ppp-errors | \
+			grep AC | wc -l)
+		  echo $R > /tmp/probe-finished ) &
 		WAIT=0
 		TO=$(grep Timeout /tmp/ppp-errors 2>/dev/null | wc -l || true)
 
@@ -59,11 +57,12 @@ ppp_concentrator_on() {
 		fi
 	done
 
-	PROCESS=$(ps -A | grep pppoe-discovery | sed s:^[[:space:]]::g | cut -f1 -d' ') || true
+	PROCESS=$(ps -A | grep pppoe-discovery | sed s:^[[:space:]]::g | \
+		  cut -f1 -d' ') || true
 	if [ $TO -ne 1 -a "$PROCESS" ]; then
 		kill $PROCESS
 	fi
-	R=`cat /tmp/probe-finished 2>/dev/null` || true
+	R=$(cat /tmp/probe-finished 2>/dev/null) || true
 	rm -f /tmp/probe-finished
 	db_progress STOP
 
@@ -91,7 +90,10 @@ reset_if_needed() {
 	fi
 
 	# Bring down previously raised interface
-	[ "$PPPOE" = "_" ] || ifconfig "$PPPOE" down && db_set ppp/interface "_" || true
+	if [ "$PPPOE" != "_" ]; then
+		ip link set "$PPPOE" down
+		db_set ppp/interface "_"
+	fi
 }
 
 valid_hostname() {
@@ -137,7 +139,7 @@ for IFACE in $INTERFACES; do
 	else
 		if [ "$PPPUP" = yes ]; then
 			log "no concentrator found on $IFACE; will bring the interface back down"
-			ifconfig $IFACE down
+			ip link set $IFACE down
 		else
 			log "ppp-udeb no concentrator found on $IFACE"
 		fi

Reply via email to