* Brian J. Murrell <[EMAIL PROTECTED]> [17.05.2008 15:45]:

> > +   local BROADCAST="192.168.1.255"         # maybe calculate from 
> > IP/NETMASK?
> > +   local   NETMASK="255.255.255.0"
> > +   local CIDR_MASK="24"                    # which must be NETMASK in 
> > other notation (maybe calculate?)
>                          ^
> Don't try to line these up at the "=".  It doesn't increase readability.

Do you think so? I believe that it is better readable

> Use the || short-circuit syntax:
> 
>       ifconfig $DEVICE $IP netmask $NETMASK broadcast $BROADCAST up || {
>               # ifconfig failed -> fallback to using ip
>               ip addr add dev $DEVICE $IP/$CIDR_MASK broadcast $BROADCAST
>               ip link set dev $DEVICE arp on  
>               ip link set dev $DEVICE up
>       }

Not very nice, especially on large conditions.
Other opinions to both suggestions?

bye, Bastian - thanks for reply

Attachment: signature.asc
Description: Digital signature

_______________________________________________
openwrt-devel mailing list
[email protected]
http://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

Reply via email to