On Wed, 2008-06-11 at 22:03 +0200, John Crispin wrote:
> applied, but forgot the signed off in the commit msg, sorry
>
> Brian J. Murrell wrote:
> > I'd like to propose the following patch to
> > package/ppp/files/etc/ppp/ip-up. It means that hotplug scripts can
> > source the network state and get information about the newly plumbed ppp
> > interface.
> >
> > Signed off by: Brian J. Murrell <[EMAIL PROTECTED]>
> >
> > Index: package/ppp/files/etc/ppp/ip-up
> > ===================================================================
> > --- package/ppp/files/etc/ppp/ip-up (revision 10709)
> > +++ package/ppp/files/etc/ppp/ip-up (working copy)
> > @@ -6,11 +6,11 @@
> > PPP_REMOTE="$5"
> > PPP_IPPARAM="$6"
> > export PPP_IFACE PPP_TTY PPP_SPEED PPP_LOCAL PPP_REMOTE PPP_IPPARAM
> > -[ -z "$PPP_IPPARAM" ] || env -i ACTION="ifup" INTERFACE="$PPP_IPPARAM"
> > DEVICE="$PPP_IFACE" PROTO=ppp /sbin/hotplug-call "iface"
> > [ -z "$PPP_IPPARAM" -o -z "$PPP_LOCAL" ] || {
> > uci_set_state network "$PPP_IPPARAM" ipaddr "$PPP_LOCAL"
> > uci_set_state network "$PPP_IPPARAM" gateway "$PPP_REMOTE"
> > }
> > +[ -z "$PPP_IPPARAM" ] || env -i ACTION="ifup" INTERFACE="$PPP_IPPARAM"
> > DEVICE="$PPP_IFACE" PROTO=ppp /sbin/hotplug-call "iface"
> >
> >
> > [ -d /etc/ppp/ip-up.d ] && {
I see the above was applied, but not my proposal for a new hotplug iface
script below. Do I need to submit it separately or is there
philosophical objection to it?
> > Signed off by: Brian J. Murrell <[EMAIL PROTECTED]>
> >
> > config_load network
> > config_get ifname "$INTERFACE" ifname
> >
> > config_load /var/state/network
> >
> > # standard hosts file already has a loopback/localhost entry
> > [ "$INTERFACE" = loopback ] && exit 0
> >
> > # need to wait for others to be done
> > n=0
> > while [ -f /tmp/edit_hosts -a $n -lt 5 ]; do
> > sleep 1
> > let n=n+1
> > done
> >
> > [ -f /tmp/edit_hosts ] && {
> > logger "Unable to update /etc/hosts due to lock file /tmp/edit_hosts
> > being present for more than 5 seconds"
> > exit 0
> > }
> >
> > # tell others we are working
> > echo $$ > /tmp/edit_hosts
> >
> > [ ifup = "$ACTION" ] && {
> > config_get addr "$INTERFACE" ipaddr
> >
> > [ -n "$addr" ] && \
> > sed -i -e "/^.* $INTERFACE$/d" -e "\$a$addr $INTERFACE"
> > /etc/hosts
> > }
> >
> > [ ifdown = "$ACTION" ] && {
> > sed -i -e "/^.* $INTERFACE$/d" /etc/hosts
> > }
> >
> > rm -f /tmp/edit_hosts
b.
signature.asc
Description: This is a digitally signed message part
_______________________________________________ openwrt-devel mailing list [email protected] http://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
