On Fri, Aug 31, 2007 at 01:45:24PM -0300, Otavio Salvador wrote:
> Eddy Petrișor <[EMAIL PROTECTED]> writes:
> 
> > Bastian Blank wrote:
> >> Hi folks
> >> 
> >> I prepared a busybox update. The following changes are not yet done:
> >> - Remove ifconfig. Scheduled since at least 3 years. 3 users left.
> >
> > ppp-udeb being one of them (i.e. have you counted here ppp-udeb)? So this 
> > means
> > broken PPPoE installs? ppp-udeb uses ifconfig in its postinst.
> 
> We might start work to remove its dependency and use ip if possible.

I took a quick look at it, attached is a possible (untested) patch
removing ppp-udeb dependency on ifconfig.

Cheers,
-- 
Jérémy Bobbio                        .''`. 
[EMAIL PROTECTED]                    : :Ⓐ  :  # apt-get install anarchism
                                    `. `'` 
                                      `-   
diff -Nur ppp-2.4.4rel-9-orig/debian/ppp-udeb.postinst 
ppp-2.4.4rel/debian/ppp-udeb.postinst
--- ppp-2.4.4rel-9-orig/debian/ppp-udeb.postinst        2007-08-31 
18:48:51.000000000 +0200
+++ ppp-2.4.4rel/debian/ppp-udeb.postinst       2007-08-31 18:51:53.000000000 
+0200
@@ -15,16 +15,12 @@
        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
@@ -91,7 +87,7 @@
        fi
 
        # Bring down previously raised interface
-       [ "$PPPOE" = "_" ] || ifconfig "$PPPOE" down && db_set ppp/interface 
"_" || true
+       [ "$PPPOE" = "_" ] || ip link set "$PPPOE" down && db_set ppp/interface 
"_" || true
 }
 
 valid_hostname() {
@@ -137,7 +133,7 @@
        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

Attachment: signature.asc
Description: Digital signature

Reply via email to