You are not logged in.
Pages: 1
iphitus seems disillusioned by people not writing scripts for netcfg2.
to counter that fact, and as I've had this on my todo list for so long, here's an /etc/ifplugd/ifplugd.action:
#!/bin/sh
case "$2" in
up)
# case'd for excluding special cases interfaces as one may want
case "$1" in
*)
# guess which profile to use
net_profile=$(grep "INTERFACE=$1" /etc/network.d/* | sed 's#:.*##' | sed 's#/etc/network.d/##')
netcfg2 $net_profile
;;
esac
;;
down)
# bring down profile associated with the given interface
netcfg2 -i $1
;;
*)
echo "Wrong arguments" > /dev/stderr
;;
esac
To know recursion, you must first know recursion.
Offline
I would like to be able to help out with stuff like this, but reading this small piece of code is enough to make me stand in awe. Maybe I should look into (bash-)scripting instead of PHP...
On-topic: I had never heard of ifplugd, but it could come in very handy, especially with this netcfg2-action... THX!
Zl.
Offline
Pages: 1