SVN: rc-scripts/trunk/sysconfig/network-scripts/functions.network

2011-08-13 Thread glen
Author: glen
Date: Sat Aug 13 15:42:40 2011
New Revision: 12304

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/functions.network
Log:
emit net-device-up events, so upstart-socket-bridge could function

Modified: rc-scripts/trunk/sysconfig/network-scripts/functions.network
==
--- rc-scripts/trunk/sysconfig/network-scripts/functions.network
(original)
+++ rc-scripts/trunk/sysconfig/network-scripts/functions.networkSat Aug 
13 15:42:40 2011
@@ -348,6 +348,8 @@
ip addr add 127.0.0.1/8 dev lo
fi
ip link set dev lo up
+   emit net-device-up IFACE=lo
+
grep -E ^(lo|any)[[:blank:]] /etc/sysconfig/static-routes | while 
read device args; do
if [[ $args = *:* ]]; then
is_no $IPV6_NETWORKING  continue
@@ -646,6 +648,7 @@
 
if ! LC_ALL=C ip link show dev $device 2/dev/null | grep -q UP; then
ip link set dev $device up /dev/null 21
+   emit net-device-up IFACE=$device
fi
timeout=0
while [ $timeout -le $max_timeout ]; do
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/functions.network

2011-04-14 Thread jajcus
Author: jajcus
Date: Thu Apr 14 11:42:29 2011
New Revision: 12228

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/functions.network
Log:
- make sure the default ip rules are preserved over network restart
  even if 'ip rule show' displays them using numeric table values.
  I have a system where 'from all lookup 255' is returned instead of
  'from all lookup local' for unknown reason, but it could also happen
  if /etc/iproute2/rt_tables file is missing or corrupted. And bad things
  happen (IPv4 not working) if the 'lookup local' rule is missing.


Modified: rc-scripts/trunk/sysconfig/network-scripts/functions.network
==
--- rc-scripts/trunk/sysconfig/network-scripts/functions.network
(original)
+++ rc-scripts/trunk/sysconfig/network-scripts/functions.networkThu Apr 
14 11:42:29 2011
@@ -475,7 +475,7 @@
/sbin/ip rule add $args
done
elif is_no $1; then
-   LC_ALL=C /sbin/ip rule show | grep -vE -e from all 
lookup (main|default|local) \$ -e  map-to  | while read prio from src args; 
do
+   LC_ALL=C /sbin/ip rule show | grep -vE -e from all 
lookup (main|default|local|253|254|255) \$ -e  map-to  | while read prio 
from src args; do
[ $src = all ]  /sbin/ip rule delete 
$args || /sbin/ip rule delete $from $src $args
done
fi
@@ -487,7 +487,7 @@
/sbin/ip -6 rule add $args
done
elif is_no $1; then
-   LC_ALL=C /sbin/ip -6 rule show | grep -vE -e from all 
lookup (main|default|local) \$ -e  map-to  | while read prio from src args; 
do
+   LC_ALL=C /sbin/ip -6 rule show | grep -vE -e from all 
lookup (main|default|local|253|254|255) \$ -e  map-to  | while read prio 
from src args; do
[ $src = all ]  /sbin/ip -6 rule delete 
$args || /sbin/ip -6 rule delete $from $src $args
done
fi
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/functions.network

2011-03-29 Thread arekm
Author: arekm
Date: Tue Mar 29 15:26:42 2011
New Revision: 12219

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/functions.network
Log:
Revert disabling IPv6. Unfortunately it disables only IPv6 addresses while 
socket(AF_INET6,...) still succeeds creating ill efect.

Modified: rc-scripts/trunk/sysconfig/network-scripts/functions.network
==
--- rc-scripts/trunk/sysconfig/network-scripts/functions.network
(original)
+++ rc-scripts/trunk/sysconfig/network-scripts/functions.networkTue Mar 
29 15:26:42 2011
@@ -370,12 +370,8 @@
 
 modprobe_net()
 {
-   if is_yes $IPV6_NETWORKING; then
-   if is_module ipv6; then
-   _modprobe single ipv6
-   fi
-   elif [ -d /proc/sys/net/ipv6 ]; then
-   sysctl -q -w net.ipv6.conf.all.disable_ipv6=1
+   if is_yes $IPV6_NETWORKING  is_module ipv6; then
+   _modprobe single ipv6
fi
 
if is_yes $IPX  is_module ipx; then
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/functions.network

2011-03-25 Thread arekm
Author: arekm
Date: Fri Mar 25 17:55:23 2011
New Revision: 12215

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/functions.network
Log:
Set sysctl value quietly.

Modified: rc-scripts/trunk/sysconfig/network-scripts/functions.network
==
--- rc-scripts/trunk/sysconfig/network-scripts/functions.network
(original)
+++ rc-scripts/trunk/sysconfig/network-scripts/functions.networkFri Mar 
25 17:55:23 2011
@@ -375,7 +375,7 @@
_modprobe single ipv6
fi
elif [ -d /proc/sys/net/ipv6 ]; then
-   sysctl -w net.ipv6.conf.all.disable_ipv6=1
+   sysctl -q -w net.ipv6.conf.all.disable_ipv6=1
fi
 
if is_yes $IPX  is_module ipx; then
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/functions.network

2011-03-23 Thread arekm
Author: arekm
Date: Wed Mar 23 21:35:00 2011
New Revision: 12212

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/functions.network
Log:
Disable IPv6 if it is not enabled in config.

Modified: rc-scripts/trunk/sysconfig/network-scripts/functions.network
==
--- rc-scripts/trunk/sysconfig/network-scripts/functions.network
(original)
+++ rc-scripts/trunk/sysconfig/network-scripts/functions.networkWed Mar 
23 21:35:00 2011
@@ -370,8 +370,12 @@
 
 modprobe_net()
 {
-   if is_yes $IPV6_NETWORKING  is_module ipv6; then
-   _modprobe single ipv6
+   if is_yes $IPV6_NETWORKING
+   if is_module ipv6; then
+   _modprobe single ipv6
+   fi
+   elif [ -d /proc/sys/net/ipv6 ]; then
+   sysctl -w net.ipv6.conf.all.disable_ipv6=0
fi
 
if is_yes $IPX  is_module ipx; then
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/functions.network

2011-03-23 Thread arekm
Author: arekm
Date: Wed Mar 23 21:42:55 2011
New Revision: 12213

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/functions.network
Log:
Really disable IPv6.

Modified: rc-scripts/trunk/sysconfig/network-scripts/functions.network
==
--- rc-scripts/trunk/sysconfig/network-scripts/functions.network
(original)
+++ rc-scripts/trunk/sysconfig/network-scripts/functions.networkWed Mar 
23 21:42:55 2011
@@ -375,7 +375,7 @@
_modprobe single ipv6
fi
elif [ -d /proc/sys/net/ipv6 ]; then
-   sysctl -w net.ipv6.conf.all.disable_ipv6=0
+   sysctl -w net.ipv6.conf.all.disable_ipv6=1
fi
 
if is_yes $IPX  is_module ipx; then
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/functions.network

2011-03-23 Thread arekm
Author: arekm
Date: Wed Mar 23 22:45:51 2011
New Revision: 12214

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/functions.network
Log:
One more fix.

Modified: rc-scripts/trunk/sysconfig/network-scripts/functions.network
==
--- rc-scripts/trunk/sysconfig/network-scripts/functions.network
(original)
+++ rc-scripts/trunk/sysconfig/network-scripts/functions.networkWed Mar 
23 22:45:51 2011
@@ -370,7 +370,7 @@
 
 modprobe_net()
 {
-   if is_yes $IPV6_NETWORKING
+   if is_yes $IPV6_NETWORKING; then
if is_module ipv6; then
_modprobe single ipv6
fi
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/functions.network

2011-03-19 Thread baggins
Author: baggins
Date: Sun Mar 20 02:00:15 2011
New Revision: 12206

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/functions.network
Log:
- use proper device


Modified: rc-scripts/trunk/sysconfig/network-scripts/functions.network
==
--- rc-scripts/trunk/sysconfig/network-scripts/functions.network
(original)
+++ rc-scripts/trunk/sysconfig/network-scripts/functions.networkSun Mar 
20 02:00:15 2011
@@ -342,7 +342,7 @@
else
is_no $IPV4_NETWORKING  continue
fi
-   /sbin/ip route add $args dev $REALDEVICE
+   /sbin/ip route add $args dev lo
done
 }
 
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/functions.network

2011-03-18 Thread baggins
Author: baggins
Date: Fri Mar 18 19:19:17 2011
New Revision: 12201

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/functions.network
Log:
- setup static routes for loopback,
  see http://wiki.squid-cache.org/Features/Tproxy4 why this is needed


Modified: rc-scripts/trunk/sysconfig/network-scripts/functions.network
==
--- rc-scripts/trunk/sysconfig/network-scripts/functions.network
(original)
+++ rc-scripts/trunk/sysconfig/network-scripts/functions.networkFri Mar 
18 19:19:17 2011
@@ -336,6 +336,14 @@
ip addr add 127.0.0.1/8 dev lo
fi
ip link set dev lo up
+   grep -E ^(lo|any)[[:blank:]] /etc/sysconfig/static-routes | while 
read device args; do
+   if [[ $args = *:* ]]; then
+   is_no $IPV6_NETWORKING  continue
+   else
+   is_no $IPV4_NETWORKING  continue
+   fi
+   /sbin/ip route add $args dev $REALDEVICE
+   done
 }
 
 set_down_loopback()
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/functions.network

2011-03-08 Thread arekm
Author: arekm
Date: Tue Mar  8 21:34:30 2011
New Revision: 12197

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/functions.network
Log:
Load ipv6 and ipx only when not built into kernel.

Modified: rc-scripts/trunk/sysconfig/network-scripts/functions.network
==
--- rc-scripts/trunk/sysconfig/network-scripts/functions.network
(original)
+++ rc-scripts/trunk/sysconfig/network-scripts/functions.networkTue Mar 
 8 21:34:30 2011
@@ -346,12 +346,16 @@
 
 modprobe_net()
 {
-   if is_yes $IPV6_NETWORKING  is_module ipv6; then
-   _modprobe single ipv6
+   if is_yes $IPV6_NETWORKING  \
+   [ $(awk '$1 ~ /^TCPv6/ { print $8 }' /proc/net/protocols 2 
/dev/null) != kernel ]  \
+   is_module ipv6; then
+   _modprobe single ipv6
fi
 
-   if is_yes $IPX  is_module ipx; then
-   _modprobe single ipx
+   if is_yes $IPX  \
+   [ $(awk '$1 ~ /^IPX/ { print $8 }' /proc/net/protocols 2 
/dev/null) != kernel ]  \
+   is_module ipx; then
+   _modprobe single ipx
fi
 }
 
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/ifup-vlan

2011-03-04 Thread arekm
Author: arekm
Date: Fri Mar  4 14:37:09 2011
New Revision: 12188

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/ifup-vlan
Log:
GVRP default on on vlans

Modified: rc-scripts/trunk/sysconfig/network-scripts/ifup-vlan
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifup-vlan(original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifup-vlanFri Mar  4 
14:37:09 2011
@@ -66,8 +66,8 @@
/sbin/ip link add link ${VLAN_DEV} name ${DEVICE} type vlan id 
${VLAN_ID}
# default yes
is_no ${VLAN_REORDER_HDR}  VLAN_REORDER_HDR=off || 
VLAN_REORDER_HDR=on
-   # default no
-   is_yes $VLAN_GVRP  VLAN_GVRP=on || VLAN_GVRP=off
+   # default yes
+   is_no $VLAN_GVRP  VLAN_GVRP=off || VLAN_GVRP=on
/sbin/ip link set ${DEVICE} type vlan reorder_hdr ${VLAN_REORDER_HDR} 
gvrp ${VLAN_GVRP}
 elif [ -x /sbin/vconfig ]; then
/sbin/vconfig set_name_type DEV_PLUS_VID_NO_PAD
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network

2011-01-24 Thread arekm
Author: arekm
Date: Mon Jan 24 19:19:14 2011
New Revision: 12082

Modified:
   rc-scripts/trunk/sysconfig/network
Log:
IPv6 networking on by default.

Modified: rc-scripts/trunk/sysconfig/network
==
--- rc-scripts/trunk/sysconfig/network  (original)
+++ rc-scripts/trunk/sysconfig/network  Mon Jan 24 19:19:14 2011
@@ -35,13 +35,13 @@
 IPXINTERNALNODENUM=
 
 # Do you need IPv6 networking ?
-IPV6_NETWORKING=no
+IPV6_NETWORKING=yes
 
 # Do you want IPv6 forwarding ?
 # then set it in /etc/sysctl.conf
 
 # Enable tunnel interfaces configuration ?
-IPV6_TUNNELCONFIG=no
+IPV6_TUNNELCONFIG=yes
 
 # Global route for IPv6 host with IPv6 forwarding
 IPV6_GLOBALROUTEGW=
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/ifup

2010-07-26 Thread jajcus
Author: jajcus
Date: Mon Jul 26 15:20:24 2010
New Revision: 11714

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/ifup
Log:
- allow per-interface configuration files for dhclient.conf – single config
  file with 'interface' directive(s) conflicts with interface name given on
  the command line.


Modified: rc-scripts/trunk/sysconfig/network-scripts/ifup
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifup (original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifup Mon Jul 26 15:20:24 2010
@@ -161,6 +161,9 @@
  dhclient)
# Can't specify a host with dhclient ?
DHCP_ARGS=$DEVICE -pf 
/var/run/dhclient.$DEVICE.pid -lf /var/lib/dhclient/dhclient.$DEVICE.leases
+   if [ -f /etc/dhclinet.$DEVICE.conf ] ; then
+   DHCP_ARGS=$DHCP_ARGS -cf 
/etc/dhclinet.$DEVICE.conf
+   fi
;;
  avahi-autoipd)
DHCP_ARGS=-D $DEVICE
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/ifup

2010-07-26 Thread jajcus
Author: jajcus
Date: Mon Jul 26 15:31:45 2010
New Revision: 11715

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/ifup
Log:
- typo


Modified: rc-scripts/trunk/sysconfig/network-scripts/ifup
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifup (original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifup Mon Jul 26 15:31:45 2010
@@ -161,8 +161,8 @@
  dhclient)
# Can't specify a host with dhclient ?
DHCP_ARGS=$DEVICE -pf 
/var/run/dhclient.$DEVICE.pid -lf /var/lib/dhclient/dhclient.$DEVICE.leases
-   if [ -f /etc/dhclinet.$DEVICE.conf ] ; then
-   DHCP_ARGS=$DHCP_ARGS -cf 
/etc/dhclinet.$DEVICE.conf
+   if [ -f /etc/dhclient.$DEVICE.conf ] ; then
+   DHCP_ARGS=$DHCP_ARGS -cf 
/etc/dhclient.$DEVICE.conf
fi
;;
  avahi-autoipd)
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts: ifdown ifup

2010-06-15 Thread jajcus
Author: jajcus
Date: Tue Jun 15 12:13:06 2010
New Revision: 11557

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/ifdown
   rc-scripts/trunk/sysconfig/network-scripts/ifup
Log:
- allow multiple dhclient instances running on one machine


Modified: rc-scripts/trunk/sysconfig/network-scripts/ifdown
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifdown   (original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifdown   Tue Jun 15 12:13:06 2010
@@ -87,7 +87,11 @@
RESULT=$?
;;
  dhclient)
-   if [ -f /var/run/dhclient.pid ];then
+   if [ -f /var/run/dhclient.$DEVICE.pid ] ; then
+   $DHCP_CLIENT -r -pf 
/var/run/dhclient.$DEVICE.pid -lf /var/lib/dhclient/dhclient.$DEVICE.leases 
2/dev/null
+   RESULT=$?
+   elif [ -f /var/run/dhclient.pid ]; then
+   # may be left by older rc-scripts
PID=$(cat /var/run/dhclient.pid)
if kill -0 $PID 2/dev/null; then
kill $PID

Modified: rc-scripts/trunk/sysconfig/network-scripts/ifup
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifup (original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifup Tue Jun 15 12:13:06 2010
@@ -160,7 +160,7 @@
;;
  dhclient)
# Can't specify a host with dhclient ?
-   DHCP_ARGS=$DEVICE
+   DHCP_ARGS=$DEVICE -pf 
/var/run/dhclient.$DEVICE.pid -lf /var/lib/dhclient/dhclient.$DEVICE.leases
;;
  avahi-autoipd)
DHCP_ARGS=-D $DEVICE
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/ifup

2010-05-18 Thread arekm
Author: arekm
Date: Tue May 18 14:13:13 2010
New Revision: 11476

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/ifup
Log:
No need for wait loop. check_link_down sleeps for specified time in 0.5s 
intervals.

Modified: rc-scripts/trunk/sysconfig/network-scripts/ifup
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifup (original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifup Tue May 18 14:13:13 2010
@@ -123,16 +123,10 @@
 fi
 
 if is_yes ${WLAN_WPA}; then
-   [ -z $WLAN_WPA_WAIT_TIMEOUT ]  WLAN_WPA_WAIT_TIMEOUT=15
/usr/sbin/wpa_supplicant -D ${WLAN_WPA_DRIVER:-wext} -c 
${WLAN_WPA_CONFIG:-/etc/wpa_supplicant.conf} -i ${DEVICE} ${WLAN_WPA_OPTIONS} 
-P /var/run/wpa_supplicant-${DEVICE}.pid -B
-   i=0
-   while [ $i -lt $WLAN_WPA_WAIT_TIMEOUT ]; do
-   i=$((i + 1))
-   # check_link_down sleeps for 0.5s
-   check_link_down ${DEVICE} 2
-   status=$?
-   [ $status = 1 ]  break
-   done
+   [ -z $WLAN_WPA_WAIT_TIMEOUT ]  WLAN_WPA_WAIT_TIMEOUT=15
+   # check_link_down sleeps for 0.5s
+   check_link_down ${DEVICE} $(( $WLAN_WPA_WAIT_TIMEOUT * 2 ))
 fi
 
 if [ $HANDLING = 2 ]; then
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/ifup

2010-05-17 Thread arekm
Author: arekm
Date: Mon May 17 21:08:57 2010
New Revision: 11472

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/ifup
Log:
Respect ZEROCONF variable for dhcpcd.

Modified: rc-scripts/trunk/sysconfig/network-scripts/ifup
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifup (original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifup Mon May 17 21:08:57 2010
@@ -147,6 +147,9 @@
  dhcpcd)
[ -n $DHCP_HOSTNAME ]  DHCP_ARGS=-h 
$DHCP_HOSTNAME
DHCP_ARGS=$DHCP_ARGS $DEVICE
+   if is_no $ZEROCONF; then
+   DHCP_ARGS=$DHCP_ARGS --noipv4ll
+   fi
;;
  dhcpxd)
[ -n $DHCP_HOSTNAME ]  DHCP_ARGS=-H 
$DHCP_HOSTNAME
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/functions.network

2010-05-17 Thread arekm
Author: arekm
Date: Mon May 17 22:16:18 2010
New Revision: 11473

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/functions.network
Log:
Don't rely on ip link UP checking. Always to mii-tool/ethtool test.

Modified: rc-scripts/trunk/sysconfig/network-scripts/functions.network
==
--- rc-scripts/trunk/sysconfig/network-scripts/functions.network
(original)
+++ rc-scripts/trunk/sysconfig/network-scripts/functions.networkMon May 
17 22:16:18 2010
@@ -605,32 +605,30 @@
 
if ! LC_ALL=C ip link show dev $1 2/dev/null | grep -q UP; then
ip link set dev $1 up /dev/null 21
-   timeout=0
-   while [ $timeout -le 6 ]; do
-   check_ethtool $1
-   e=$?
-   check_iwconfig $1
-   i=$?
-   # trust ethtool and iwconfig
-   if [ $i -eq 1 ] || [ $e -eq 1 ]; then
-   return 1
-   fi
-   # use mii check only if all other check are unsupported
-   # (mii check lies too often)
-   check_mii_tool $1
-   m=$?
-   if [ $m -eq 1 ]  [ $i -eq 2 ]  [ $e -eq 2 ]; then
-   return 1
-   fi
-   usleep 50
-   timeout=$((timeout+1))
-   done
-   # do not abort dhclient if all the checks are unsupported
-   if [ $m -eq 2 ]  [ $i -eq 2 ]  [ $e -eq 2 ]; then
-   return 2
+   fi
+   timeout=0
+   while [ $timeout -le 6 ]; do
+   check_ethtool $1
+   e=$?
+   check_iwconfig $1
+   i=$?
+   # trust ethtool and iwconfig
+   if [ $i -eq 1 ] || [ $e -eq 1 ]; then
+   return 1
+   fi
+   # use mii check only if all other check are unsupported
+   # (mii check lies too often)
+   check_mii_tool $1
+   m=$?
+   if [ $m -eq 1 ]  [ $i -eq 2 ]  [ $e -eq 2 ]; then
+   return 1
fi
-   return 0
+   usleep 50
+   timeout=$((timeout+1))
+   done
+   # do not abort dhclient if all the checks are unsupported
+   if [ $m -eq 2 ]  [ $i -eq 2 ]  [ $e -eq 2 ]; then
+   return 2
fi
-
-   return 2
+   return 0
 }
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/functions.network

2010-05-17 Thread arekm
Author: arekm
Date: Mon May 17 22:20:28 2010
New Revision: 11474

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/functions.network
Log:
Support for max timeout as parameter.

Modified: rc-scripts/trunk/sysconfig/network-scripts/functions.network
==
--- rc-scripts/trunk/sysconfig/network-scripts/functions.network
(original)
+++ rc-scripts/trunk/sysconfig/network-scripts/functions.networkMon May 
17 22:20:28 2010
@@ -598,19 +598,24 @@
 # 2 - unknown/unsupported
 check_link_down ()
 {
-   local e i m timeout
+   local e i m timeout device max_timeout
+   device=$1
+   max_timeout=$2
+
if [ ! -x /sbin/mii-tool -a ! -x /sbin/ethtool -a ! -x /sbin/iwconfig 
]; then
return 2
fi
 
-   if ! LC_ALL=C ip link show dev $1 2/dev/null | grep -q UP; then
-   ip link set dev $1 up /dev/null 21
+   [ -z $max_timeout ]  max_timeout=6
+
+   if ! LC_ALL=C ip link show dev $device 2/dev/null | grep -q UP; then
+   ip link set dev $device up /dev/null 21
fi
timeout=0
-   while [ $timeout -le 6 ]; do
-   check_ethtool $1
+   while [ $timeout -le $max_timeout ]; do
+   check_ethtool $device
e=$?
-   check_iwconfig $1
+   check_iwconfig $device
i=$?
# trust ethtool and iwconfig
if [ $i -eq 1 ] || [ $e -eq 1 ]; then
@@ -618,7 +623,7 @@
fi
# use mii check only if all other check are unsupported
# (mii check lies too often)
-   check_mii_tool $1
+   check_mii_tool $device
m=$?
if [ $m -eq 1 ]  [ $i -eq 2 ]  [ $e -eq 2 ]; then
return 1
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network

2009-11-22 Thread glen
Author: glen
Date: Sun Nov 22 10:18:58 2009
New Revision: 10991

Modified:
   rc-scripts/trunk/sysconfig/network
Log:
- mention HOTPLUG

Modified: rc-scripts/trunk/sysconfig/network
==
--- rc-scripts/trunk/sysconfig/network  (original)
+++ rc-scripts/trunk/sysconfig/network  Sun Nov 22 10:18:58 2009
@@ -58,3 +58,7 @@
 # Specify interface on which you want to enable tleds software
 # (also you need tleds package installed) -- default set to no
 TLEDS_DEV=no
+
+# enable globally for all network interfaces.
+# bring up from hotplug (udev for example) (default to no)
+#HOTPLUG=yes
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/functions.network

2009-11-22 Thread glen
Author: glen
Date: Sun Nov 22 14:51:01 2009
New Revision: 10994

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/functions.network
Log:
- nwid already set earlier

Modified: rc-scripts/trunk/sysconfig/network-scripts/functions.network
==
--- rc-scripts/trunk/sysconfig/network-scripts/functions.network
(original)
+++ rc-scripts/trunk/sysconfig/network-scripts/functions.networkSun Nov 
22 14:51:01 2009
@@ -532,8 +532,6 @@
iwconfig ${device} txpower $val
val=$(eval echo \$${prefix}WLAN_RETRY)  [ $val ]  \
iwconfig ${device} retry $val
-   val=$(eval echo \$${prefix}WLAN_NWID)  [ $val ]  \
-   iwconfig ${device} nwid $val
 
# essid should be last due to network rescanning by wlan devices
val=$(eval echo \$${prefix}WLAN_ESSID)  [ $val ]  \
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/functions.network

2009-11-22 Thread glen
Author: glen
Date: Sun Nov 22 14:54:44 2009
New Revision: 10995

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/functions.network
Log:
- formatting

Modified: rc-scripts/trunk/sysconfig/network-scripts/functions.network
==
--- rc-scripts/trunk/sysconfig/network-scripts/functions.network
(original)
+++ rc-scripts/trunk/sysconfig/network-scripts/functions.networkSun Nov 
22 14:54:44 2009
@@ -594,35 +594,39 @@
 # 2 - unknown/unsupported
 check_link_down ()
 {
-   if [ -x /sbin/mii-tool -o -x /sbin/ethtool -o -x /sbin/iwconfig ]; then
-   if ! LC_ALL=C ip link show dev $1 2/dev/null| grep -q UP; then
-   ip link set dev $1 up /dev/null 21
-   timeout=0
-   while [ $timeout -le 6 ]; do
-   check_ethtool $1
-   e=$?
-   check_iwconfig $1
-   i=$?
-   # trust ethtool and iwconfig
-   if [ $i -eq 1 ] || [ $e -eq 1 ]; then
-   return 1
-   fi
-   # use mii check only if all other check are 
unsupported
-   # (mii check lies too often)
-   check_mii_tool $1
-   m=$?
-   if [ $m -eq 1 ]  [ $i -eq 2 ]  [ $e -eq 2 
]; then
-   return 1
-   fi
-   usleep 50
-   timeout=$((timeout+1))
-   done
-   # do not abort dhclient if all the checks are 
unsupported
-   if [ $m -eq 2 ]  [ $i -eq 2 ]  [ $e -eq 2 ]; then
-   return 2
+   local e i m timeout
+   if [ ! -x /sbin/mii-tool -a ! -x /sbin/ethtool -a ! -x /sbin/iwconfig 
]; then
+   return 2
+   fi
+
+   if ! LC_ALL=C ip link show dev $1 2/dev/null | grep -q UP; then
+   ip link set dev $1 up /dev/null 21
+   timeout=0
+   while [ $timeout -le 6 ]; do
+   check_ethtool $1
+   e=$?
+   check_iwconfig $1
+   i=$?
+   # trust ethtool and iwconfig
+   if [ $i -eq 1 ] || [ $e -eq 1 ]; then
+   return 1
+   fi
+   # use mii check only if all other check are unsupported
+   # (mii check lies too often)
+   check_mii_tool $1
+   m=$?
+   if [ $m -eq 1 ]  [ $i -eq 2 ]  [ $e -eq 2 ]; then
+   return 1
fi
-   return 0
+   usleep 50
+   timeout=$((timeout+1))
+   done
+   # do not abort dhclient if all the checks are unsupported
+   if [ $m -eq 2 ]  [ $i -eq 2 ]  [ $e -eq 2 ]; then
+   return 2
fi
+   return 0
fi
+
return 2
 }
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/functions.network

2009-11-16 Thread gotar
Author: gotar
Date: Mon Nov 16 15:00:16 2009
New Revision: 10968

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/functions.network
Log:
- it's common for WiFi that all the methods of link state determinaion fail,
  don't abort dhclient in such case


Modified: rc-scripts/trunk/sysconfig/network-scripts/functions.network
==
--- rc-scripts/trunk/sysconfig/network-scripts/functions.network
(original)
+++ rc-scripts/trunk/sysconfig/network-scripts/functions.networkMon Nov 
16 15:00:16 2009
@@ -27,7 +27,7 @@
# and forgot to alter DEVICE= line you won't accidentally bring down 
eth0
# while executing ifdown eth1. We do that only if configuration file 
exists
# (sometimes ifcfg-xyz isn't needed at all like server-side pppoe pppX 
interfaces)
-   if [ $foundconfig -eq 1 -a $DEVICE -a  $DEVNAME != $DEVICE ]; 
then
+   if [ $foundconfig -eq 1 -a $DEVICE -a $DEVNAME != $DEVICE ]; 
then
echo 2 $0: DEVICE specified in $CONFIG does not match 
filename. Aborting!
exit 1
fi
@@ -618,6 +618,10 @@
usleep 50
timeout=$((timeout+1))
done
+   # do not abort dhclient if all the checks are 
unsupported
+   if [ $m -eq 2 ]  [ $i -eq 2 ]  [ $e -eq 2 ]; then
+   return 2
+   fi
return 0
fi
fi
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/functions.network

2009-11-16 Thread gotar
Author: gotar
Date: Mon Nov 16 15:03:50 2009
New Revision: 10969

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/functions.network
Log:
- check rfkill before iwconfig (more common and doesn't require binary)
- note /sys/class/net/${1}/operstate file on some systems


Modified: rc-scripts/trunk/sysconfig/network-scripts/functions.network
==
--- rc-scripts/trunk/sysconfig/network-scripts/functions.network
(original)
+++ rc-scripts/trunk/sysconfig/network-scripts/functions.networkMon Nov 
16 15:03:50 2009
@@ -577,15 +577,15 @@
 check_iwconfig ()
 {
local output
-   [ -x /sbin/iwconfig ] || return 2
-   output=$(LC_ALL=C iwconfig $1 21)
-   # radio off is ipwxxx only feature (and there is no radio on)
-   echo $output | grep -q radio off  return 0
# rfkill state (are there devices with multiple rfkill buttons?)
output=$(cat /sys/class/net/${1}/device/rfkill*/state 2 /dev/null)
# 1 is rfkill not active
[ $output = 1 ]  return 1
[ $output = 0 -o $output = 2 ]  return 0
+   [ -x /sbin/iwconfig ] || return 2
+   output=$(LC_ALL=C iwconfig $1 21)
+   # radio off is ipwxxx only feature (and there is no radio on)
+   echo $output | grep -q radio off  return 0
# XXX: need more generic checks for wifi
return 2
 }
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/functions.network

2009-11-16 Thread gotar
Author: gotar
Date: Mon Nov 16 15:07:35 2009
New Revision: 10970

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/functions.network
Log:
- don't call check_mii_tool if ethtool or iwconfig reported success


Modified: rc-scripts/trunk/sysconfig/network-scripts/functions.network
==
--- rc-scripts/trunk/sysconfig/network-scripts/functions.network
(original)
+++ rc-scripts/trunk/sysconfig/network-scripts/functions.networkMon Nov 
16 15:07:35 2009
@@ -14,11 +14,11 @@
DEVNAME=${DEVNAME##tnlcfg-}
 
if [[ $CONFIG = /* ]]; then
-   if [ -f $CONFIG ] ; then
+   if [ -f $CONFIG ]; then
. $CONFIG
foundconfig=1
fi
-   elif [ -f /etc/sysconfig/interfaces/$CONFIG ] ; then
+   elif [ -f /etc/sysconfig/interfaces/$CONFIG ]; then
. /etc/sysconfig/interfaces/$CONFIG
foundconfig=1
fi
@@ -205,12 +205,12 @@
eval IP4ADDROPT=\$IP_AOPTS${IP4_PRIM_IF:-}
eval IP4ROUTEOPT=\$IP_ROPTS${IP4_PRIM_IF:-}
fi
-   if [ ${IP6_PRIM_IF} ] ; then
+   if [ ${IP6_PRIM_IF} ]; then
eval IP6ADDR=\$IPADDR${IP6_PRIM_IF:-}
eval IP6ADDROPT=\$IPV6_AOPTS${IP6_PRIM_IF:-}
eval IP6ADDRLABEL=\$IP_LABEL${IP6_PRIM_IF:-}
fi
-   if [ ${IP4_SRC_IF} ] ; then
+   if [ ${IP4_SRC_IF} ]; then
eval IP4SRCADDR=\$IPADDR${IP4_SRC_IF}
IP4SRCADDR=$(echo ${IP4SRCADDR} | awk ' { gsub(/\/.*/,NIL); 
print src  $0; } ')
fi
@@ -242,7 +242,7 @@
fi
 
# ARP ready devices
-   if [ $ARP ] ; then
+   if [ $ARP ]; then
if is_yes $ARP; then
ARP=arp on
else
@@ -313,7 +313,7 @@
local args
 
if [ -f /etc/sysconfig/static-routes ]; then
-   if [ $1 = on -o $1 = yes ] ; then
+   if [ $1 = on -o $1 = yes ]; then
grep -E ^(none|any)[[:blank:]] 
/etc/sysconfig/static-routes | while read device args; do
/sbin/ip route add $args
done
@@ -422,7 +422,7 @@
 # Retrievies PPPD PID and real interface name from /var/run/ppp-*.pid
 get_ppp_device_and_pid ()
 {
-   if [ -f /var/run/ppp-$DEVNAME.pid ] ; then
+   if [ -f /var/run/ppp-$DEVNAME.pid ]; then
eval $(
{
read PID ; echo PID='$PID'
@@ -430,7 +430,7 @@
}  /var/run/ppp-$DEVNAME.pid)
fi
 
-   if [ -z $REALDEVICE ] ; then
+   if [ -z $REALDEVICE ]; then
REALDEVICE=$DEVICE
fi
 }
@@ -441,7 +441,7 @@
 {
local args prio from src
 
-   if [ -f /etc/sysconfig/static-routes ] ; then
+   if [ -f /etc/sysconfig/static-routes ]; then
if is_yes $1; then
grep -E 
^(from|to|iif|tos|fwmark|dev|pref|priority|prio)[[:blank:]] 
/etc/sysconfig/static-routes | while read args; do
/sbin/ip rule add $args
@@ -600,18 +600,18 @@
ip link set dev $1 up /dev/null 21
timeout=0
while [ $timeout -le 6 ]; do
-   check_mii_tool $1
-   m=$?
check_ethtool $1
e=$?
check_iwconfig $1
i=$?
# trust ethtool and iwconfig
-   if [ $i -eq 1 ] || [ $e -eq 1 ] ; then
+   if [ $i -eq 1 ] || [ $e -eq 1 ]; then
return 1
fi
# use mii check only if all other check are 
unsupported
# (mii check lies too often)
+   check_mii_tool $1
+   m=$?
if [ $m -eq 1 ]  [ $i -eq 2 ]  [ $e -eq 2 
]; then
return 1
fi
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/functions.network

2009-11-16 Thread gotar
Author: gotar
Date: Mon Nov 16 15:49:08 2009
New Revision: 10971

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/functions.network
Log:
- unknown/unsupported: return 2 if no tools found or all the methods failed


Modified: rc-scripts/trunk/sysconfig/network-scripts/functions.network
==
--- rc-scripts/trunk/sysconfig/network-scripts/functions.network
(original)
+++ rc-scripts/trunk/sysconfig/network-scripts/functions.networkMon Nov 
16 15:49:08 2009
@@ -73,7 +73,7 @@
if [ $domain ]; then
# XXX umask and possible /etc/resolv.conf symlink breakage
 /etc/resolv.conf.new
-   if ! grep -q search $domain /etc/resolv.conf ; then
+   if ! grep -q search $domain /etc/resolv.conf; then
echo search $domain  /etc/resolv.conf.new
fi
echo domain $domain  /etc/resolv.conf.new
@@ -363,8 +363,8 @@
 
prefix=0
endp=0
-   for n in $netmask ; do
-   for i in 128 64 32 16 8 4 2 1 ; do
+   for n in $netmask; do
+   for i in 128 64 32 16 8 4 2 1; do
if [ $(($n  $i)) -ne 0 ]; then
if [ $endp -eq 0 ]; then
prefix=$(($prefix + 1))
@@ -394,13 +394,13 @@
fi
for i in 1 2 3 4; do
case $prefix in
- 7)a=254 ;;
- 6)a=252 ;;
- 5)a=248 ;;
- 4)a=240 ;;
- 3)a=224 ;;
- 2)a=192 ;;
- 1)a=128 ;;
+ 7)a=254;;
+ 6)a=252;;
+ 5)a=248;;
+ 4)a=240;;
+ 3)a=224;;
+ 2)a=192;;
+ 1)a=128;;
  *)
[ $prefix -ge 8 ]  a=255
[ $prefix -le 0 ]  a=0
@@ -425,8 +425,8 @@
if [ -f /var/run/ppp-$DEVNAME.pid ]; then
eval $(
{
-   read PID ; echo PID='$PID'
-   read REALDEVICE ; echo REALDEVICE=$REALDEVICE
+   read PID; echo PID='$PID'
+   read REALDEVICE; echo REALDEVICE=$REALDEVICE
}  /var/run/ppp-$DEVNAME.pid)
fi
 
@@ -593,10 +593,11 @@
 # returns
 # 0 - link down
 # 1 - link up
+# 2 - unknown/unsupported
 check_link_down ()
 {
if [ -x /sbin/mii-tool -o -x /sbin/ethtool -o -x /sbin/iwconfig ]; then
-   if ! LC_ALL=C ip link show dev $1 2/dev/null| grep -q UP ; then
+   if ! LC_ALL=C ip link show dev $1 2/dev/null| grep -q UP; then
ip link set dev $1 up /dev/null 21
timeout=0
while [ $timeout -le 6 ]; do
@@ -625,5 +626,5 @@
return 0
fi
fi
-   return 1
+   return 2
 }
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/ifup-br

2009-11-04 Thread gotar
Author: gotar
Date: Wed Nov  4 09:03:48 2009
New Revision: 10945

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/ifup-br
Log:
- don't disable bridged device just before bridge starts! - this
  interrupts every subdevice currently active (like VLAN interfaces
  in another bridges)


Modified: rc-scripts/trunk/sysconfig/network-scripts/ifup-br
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifup-br  (original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifup-br  Wed Nov  4 09:03:48 2009
@@ -43,9 +43,8 @@
 # set all major variables
 setup_ip_param
 
-# set device down and forget all addresses
+# forget all addresses
 for device in $BRIDGE_DEVS; do
-   ip link set ${device} down
LC_ALL=C ip addr flush dev ${device} 21 | grep -v Nothing to flush
 done
 
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/ifup-br

2009-11-03 Thread gotar
Author: gotar
Date: Tue Nov  3 16:47:56 2009
New Revision: 10933

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/ifup-br
Log:
- bridge forward delay is used regardless of STP,
- NB hello timer runs always too, it's just not used without STP


Modified: rc-scripts/trunk/sysconfig/network-scripts/ifup-br
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifup-br  (original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifup-br  Tue Nov  3 16:47:56 2009
@@ -69,12 +69,12 @@
 # standard
 [ -n $AGEING ]  brctl setageing $AGEING
 [ -n $GCINT ]  brctl setgcint $GCINT
+[ -n $FD ]  brctl setfd ${DEVICE} $FD
 
 # spanning tree protocol
 if is_yes $SPANNING_TREE; then
brctl stp ${DEVICE} yes
[ -n $BRIDGEPRIO ]  brctl setbridgeprio ${DEVICE} $BRIDGEPRIO
-   [ -n $FD ]  brctl setfd ${DEVICE} $FD
[ -n $HELLO ]  brctl sethello ${DEVICE} $HELLO
[ -n $MAXAGE ]  brctl setmaxage ${DEVICE} $MAXAGE
[ -n $PATHCOST -a -n $PATHCOST_PORT ]  brctl setpathcost 
${DEVICE} $PATHCOST_PORT $PATHCOST
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/ifdown-br

2009-11-03 Thread gotar
Author: gotar
Date: Wed Nov  4 08:58:49 2009
New Revision: 10944

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/ifdown-br
Log:
- dont't set bridged device down! some subdevice can still be used
  (e.g. VLAN interface in another bridge),
- NOTE: addresses from underlying device are flushed on ifup-br so
  there should not exist anyone anyway


Modified: rc-scripts/trunk/sysconfig/network-scripts/ifdown-br
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifdown-br(original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifdown-brWed Nov  4 
08:58:49 2009
@@ -43,7 +43,6 @@
 # set device down and forget all addresses
 for device in ${BRIDGE_DEVS}; do
LC_ALL=C ip addr flush dev ${device} 21 | grep -v Nothing to flush
-   ip link set ${device} down
brctl delif ${DEVICE} ${device}
 done
 
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network

2009-06-05 Thread glen
Author: glen
Date: Fri Jun  5 20:30:17 2009
New Revision: 10372

Modified:
   rc-scripts/trunk/sysconfig/network
Log:
- update udev path

Modified: rc-scripts/trunk/sysconfig/network
==
--- rc-scripts/trunk/sysconfig/network  (original)
+++ rc-scripts/trunk/sysconfig/network  Fri Jun  5 20:30:17 2009
@@ -15,7 +15,7 @@
 HOSTNAME=pldmachine
 
 # Allow udev to create /etc/sysconfig/interfaces/ifcfg-* automatically?
-# See /lib/udev/udev_net_helper for details.
+# See /lib/udev/net_helper for details.
 AUTOMATIC_IFCFG=no
 
 # Set NIS domain name here if you use NIS
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/functions.network

2009-06-03 Thread glen
Author: glen
Date: Wed Jun  3 08:28:10 2009
New Revision: 10367

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/functions.network
Log:
- i don't think cat output is localized

Modified: rc-scripts/trunk/sysconfig/network-scripts/functions.network
==
--- rc-scripts/trunk/sysconfig/network-scripts/functions.network
(original)
+++ rc-scripts/trunk/sysconfig/network-scripts/functions.networkWed Jun 
 3 08:28:10 2009
@@ -581,7 +581,7 @@
# radio off is ipwxxx only feature (and there is no radio on)
echo $output | grep -q radio off  return 0
# rfkill state (are there devices with multiple rfkill buttons?)
-   local output=$(LC_ALL=C cat /sys/class/net/${1}/device/rfkill*/state 2 
/dev/null)
+   local output=$(cat /sys/class/net/${1}/device/rfkill*/state 2 
/dev/null)
# 1 is rfkill not active
[ $output = 1 ]  return 1
[ $output = 0 -o $output = 2 ]  return 0
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/functions.network

2009-06-03 Thread glen
Author: glen
Date: Wed Jun  3 08:29:46 2009
New Revision: 10369

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/functions.network
Log:
- one local should be enough

Modified: rc-scripts/trunk/sysconfig/network-scripts/functions.network
==
--- rc-scripts/trunk/sysconfig/network-scripts/functions.network
(original)
+++ rc-scripts/trunk/sysconfig/network-scripts/functions.networkWed Jun 
 3 08:29:46 2009
@@ -576,12 +576,13 @@
 # 2 - unsupported
 check_iwconfig ()
 {
+   local output
[ -x /sbin/iwconfig ] || return 2
-   local output=$(LC_ALL=C iwconfig $1 21)
+   output=$(LC_ALL=C iwconfig $1 21)
# radio off is ipwxxx only feature (and there is no radio on)
echo $output | grep -q radio off  return 0
# rfkill state (are there devices with multiple rfkill buttons?)
-   local output=$(cat /sys/class/net/${1}/device/rfkill*/state 2 
/dev/null)
+   output=$(cat /sys/class/net/${1}/device/rfkill*/state 2 /dev/null)
# 1 is rfkill not active
[ $output = 1 ]  return 1
[ $output = 0 -o $output = 2 ]  return 0
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/functions.network

2009-06-02 Thread arekm
Author: arekm
Date: Tue Jun  2 22:34:53 2009
New Revision: 10366

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/functions.network
Log:
Add rfkill support.

Modified: rc-scripts/trunk/sysconfig/network-scripts/functions.network
==
--- rc-scripts/trunk/sysconfig/network-scripts/functions.network
(original)
+++ rc-scripts/trunk/sysconfig/network-scripts/functions.networkTue Jun 
 2 22:34:53 2009
@@ -580,6 +580,11 @@
local output=$(LC_ALL=C iwconfig $1 21)
# radio off is ipwxxx only feature (and there is no radio on)
echo $output | grep -q radio off  return 0
+   # rfkill state (are there devices with multiple rfkill buttons?)
+   local output=$(LC_ALL=C cat /sys/class/net/${1}/device/rfkill*/state 2 
/dev/null)
+   # 1 is rfkill not active
+   [ $output = 1 ]  return 1
+   [ $output = 0 -o $output = 2 ]  return 0
# XXX: need more generic checks for wifi
return 2
 }
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/functions.network

2009-04-23 Thread arekm
Author: arekm
Date: Thu Apr 23 22:59:14 2009
New Revision: 10333

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/functions.network
Log:
Don't rely on mii check (it's unreliable). 'radio off' clarifications. Less 
iterations in loop.

Modified: rc-scripts/trunk/sysconfig/network-scripts/functions.network
==
--- rc-scripts/trunk/sysconfig/network-scripts/functions.network
(original)
+++ rc-scripts/trunk/sysconfig/network-scripts/functions.networkThu Apr 
23 22:59:14 2009
@@ -578,8 +578,9 @@
 {
[ -x /sbin/iwconfig ] || return 2
local output=$(LC_ALL=C iwconfig $1 21)
+   # radio off is ipwxxx only feature (and there is no radio on)
echo $output | grep -q radio off  return 0
-   # XXX why no 'radio on' check?
+   # XXX: need more generic checks for wifi
return 2
 }
 
@@ -592,17 +593,20 @@
if ! LC_ALL=C ip link show dev $1 2/dev/null| grep -q UP ; then
ip link set dev $1 up /dev/null 21
timeout=0
-   while [ $timeout -le 10 ]; do
+   while [ $timeout -le 6 ]; do
check_mii_tool $1
m=$?
check_ethtool $1
e=$?
check_iwconfig $1
i=$?
-   if [ $m -eq 1 ] || [ $e -eq 1 ] ; then
+   # trust ethtool and iwconfig
+   if [ $i -eq 1 ] || [ $e -eq 1 ] ; then
return 1
fi
-   if [ $m -eq 2 ]  [ $e -eq 2 ]  [ $i -eq 2 
]; then
+   # use mii check only if all other check are 
unsupported
+   # (mii check lies too often)
+   if [ $m -eq 1 ]  [ $i -eq 2 ]  [ $e -eq 2 
]; then
return 1
fi
usleep 50
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/ifup-aliases

2009-03-26 Thread baggins
Author: baggins
Date: Thu Mar 26 14:33:05 2009
New Revision: 10253

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/ifup-aliases
Log:
- set addrlabel only if specified


Modified: rc-scripts/trunk/sysconfig/network-scripts/ifup-aliases
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifup-aliases (original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifup-aliases Thu Mar 26 
14:33:05 2009
@@ -55,7 +55,7 @@
if echo $IP_ADDR | grep -q :; then
if is_yes ${IPV6_NETWORKING}; then
ip -6 addr add ${IP_ADDR} dev ${DEVICE} ${IP_ADDR_OPT}
-   ip -6 addrlabel add prefix ${IP_ADDR} dev ${DEVICE} 
label ${IP_ADDR_LABEL}
+   [ -n ${IP_ADDR_LABEL} ]  ip -6 addrlabel add prefix 
${IP_ADDR} dev ${DEVICE} label ${IP_ADDR_LABEL}
fi
elif is_yes ${IPV4_NETWORKING}; then
# If broadcast is missing then autocalculate it
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/ifup-aliases

2009-03-26 Thread baggins
Author: baggins
Date: Thu Mar 26 16:11:57 2009
New Revision: 10264

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/ifup-aliases
Log:
- more readable


Modified: rc-scripts/trunk/sysconfig/network-scripts/ifup-aliases
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifup-aliases (original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifup-aliases Thu Mar 26 
16:11:57 2009
@@ -55,7 +55,9 @@
if echo $IP_ADDR | grep -q :; then
if is_yes ${IPV6_NETWORKING}; then
ip -6 addr add ${IP_ADDR} dev ${DEVICE} ${IP_ADDR_OPT}
-   [ -n ${IP_ADDR_LABEL} ]  ip -6 addrlabel add prefix 
${IP_ADDR} dev ${DEVICE} label ${IP_ADDR_LABEL}
+   if [ -n ${IP_ADDR_LABEL} ]; then
+   ip -6 addrlabel add prefix ${IP_ADDR} dev 
${DEVICE} label ${IP_ADDR_LABEL}
+   fi
fi
elif is_yes ${IPV4_NETWORKING}; then
# If broadcast is missing then autocalculate it
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/functions.network

2009-03-20 Thread arekm
Author: arekm
Date: Fri Mar 20 17:03:57 2009
New Revision: 10221

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/functions.network
Log:
Set nickname only when specified in config since many wifi adapters don't 
support this setting.

Modified: rc-scripts/trunk/sysconfig/network-scripts/functions.network
==
--- rc-scripts/trunk/sysconfig/network-scripts/functions.network
(original)
+++ rc-scripts/trunk/sysconfig/network-scripts/functions.networkFri Mar 
20 17:03:57 2009
@@ -473,17 +473,12 @@
 
local val wlan_mode
 
-   if val=$(eval echo \$${prefix}WLAN_NICKNAME)  [ -z $val ]; then
-WLAN_NICKNAME=$(hostname -f 2/dev/null || hostname 
2/dev/null || echo localhost)
-   else
-WLAN_NICKNAME=$val
-   fi
-
# wlan mode needs to be first
wlan_mode=$(eval echo \$${prefix}WLAN_MODE)  [ $wlan_mode ]  \
iwconfig ${device} mode $wlan_mode
 
-   iwconfig ${device} nick ${WLAN_NICKNAME}
+   val=$(eval echo \$${prefix}WLAN_NICKNAME)  [ $val ]  \
+   iwconfig ${device} nick $val
 
val=$(eval echo \$${prefix}WLAN_NWID)  [ $val ]  \
iwconfig ${device} nwid $val
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/functions.network

2009-03-10 Thread baggins
Author: baggins
Date: Tue Mar 10 12:11:05 2009
New Revision: 10193

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/functions.network
Log:
- remove IP6_SRC_IF dead code
- started adding IP_LABEL


Modified: rc-scripts/trunk/sysconfig/network-scripts/functions.network
==
--- rc-scripts/trunk/sysconfig/network-scripts/functions.network
(original)
+++ rc-scripts/trunk/sysconfig/network-scripts/functions.networkTue Mar 
10 12:11:05 2009
@@ -201,6 +201,7 @@
if [[ ${IP4ADDR} = *:* ]]; then
IP6ADDR=${IP4ADDR}
IP4ADDR=
+   eval IP6ADDRLABEL=\$IP_LABEL${IP6_PRIM_IF:-}
else
eval IP4ADDROPT=\$IP_AOPTS${IP4_PRIM_IF:-}
eval IP4ROUTEOPT=\$IP_ROPTS${IP4_PRIM_IF:-}
@@ -213,10 +214,6 @@
eval IP4SRCADDR=\$IPADDR${IP4_SRC_IF}
IP4SRCADDR=$(echo ${IP4SRCADDR} | awk ' { gsub(/\/.*/,NIL); 
print src  $0; } ')
fi
-   if [ ${IP6_SRC_IF} ] ; then
-   eval IP6SRCADDR=\$IPADDR${IP6_SRC_IF}
-   IP6SRCADDR=$(echo ${IP6SRCADDR} | awk ' { gsub(/\/.*/,NIL); 
print src  $0; } ')
-   fi
 
# new rc-scripts 0.4.x option
if [ -z $HANDLING ]; then
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/functions.network

2009-03-10 Thread baggins
Author: baggins
Date: Tue Mar 10 12:16:11 2009
New Revision: 10194

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/functions.network
Log:
- allow addrlabel setting for ipv4 adresses


Modified: rc-scripts/trunk/sysconfig/network-scripts/functions.network
==
--- rc-scripts/trunk/sysconfig/network-scripts/functions.network
(original)
+++ rc-scripts/trunk/sysconfig/network-scripts/functions.networkTue Mar 
10 12:16:11 2009
@@ -201,14 +201,15 @@
if [[ ${IP4ADDR} = *:* ]]; then
IP6ADDR=${IP4ADDR}
IP4ADDR=
-   eval IP6ADDRLABEL=\$IP_LABEL${IP6_PRIM_IF:-}
else
eval IP4ADDROPT=\$IP_AOPTS${IP4_PRIM_IF:-}
eval IP4ROUTEOPT=\$IP_ROPTS${IP4_PRIM_IF:-}
+   eval IP4ADDRLABEL=\$IP_LABEL${IP4_PRIM_IF:-}
fi
if [ ${IP6_PRIM_IF} ] ; then
eval IP6ADDR=\$IPADDR${IP6_PRIM_IF:-}
eval IP6ADDROPT=\$IPV6_AOPTS${IP6_PRIM_IF:-}
+   eval IP6ADDRLABEL=\$IP_LABEL${IP6_PRIM_IF:-}
fi
if [ ${IP4_SRC_IF} ] ; then
eval IP4SRCADDR=\$IPADDR${IP4_SRC_IF}
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/ifup

2009-03-10 Thread baggins
Author: baggins
Date: Tue Mar 10 12:20:34 2009
New Revision: 10195

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/ifup
Log:
- add IP_LABEL support


Modified: rc-scripts/trunk/sysconfig/network-scripts/ifup
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifup (original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifup Tue Mar 10 12:20:34 2009
@@ -191,6 +191,9 @@
else
ip addr add ${IP4ADDR} ${ALIAS} dev ${DEVICE} 
${IP4ADDROPT}
fi
+   if [ -n ${IP4ADDRLABEL} ]; then
+   ip addrlabel add prefix ${IP4ADDR} dev ${DEVICE} label 
${IP4ADDRLABEL}
+   fi
fi
 
# Set device up
@@ -199,6 +202,9 @@
# IPv6 in use ?
if is_yes $IPV6_NETWORKING  [ -n ${IP6ADDR} ]; then
ip addr add ${IP6ADDR} dev ${DEVICE} ${IP6ADDROPT}
+   if [ -n ${IP6ADDRLABEL} ]; then
+   ip addrlabel add prefix ${IP6ADDR} dev ${DEVICE} label 
${IP6ADDRLABEL}
+   fi
fi
 
if is_yes $IPV4_NETWORKING  [ -n ${IP4ADDR} -a -x /sbin/arping ]; 
then
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/ifup-aliases

2009-03-10 Thread baggins
Author: baggins
Date: Tue Mar 10 12:33:51 2009
New Revision: 10196

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/ifup-aliases
Log:
- removed dead code


Modified: rc-scripts/trunk/sysconfig/network-scripts/ifup-aliases
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifup-aliases (original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifup-aliases Tue Mar 10 
12:33:51 2009
@@ -7,9 +7,6 @@
 
 # Add all addresses
 for IP_ADDR in $IPADDR_ALIASES; do
-   IP_ADDR_OPT=
-   IP_ROUTE_OPT=
-
[ -z $IP_ADDR ]  continue
# Be sure that primary address is added
if [ $IP_ADDR = $IP4ADDR -o $IP_ADDR = $IP6ADDR ]; then
@@ -18,18 +15,11 @@
fi
fi
if is_yes ${IPV4_NETWORKING}; then
-   # If broadcast is missing then autocalculate it
-   if ! (echo $IP_ADDR_OPT | grep -qE brd|broadcast); then
-   IP_ADDR_OPT=brd + ${IP_ADDR_OPT}
-   fi
-   ip -4 addr add ${IP_ADDR} dev ${DEVICE} ${IP_ADDR_OPT}
+   ip -4 addr add ${IP_ADDR} dev ${DEVICE} brd +
fi
 done
 
 for IP_ADDR in $IPV6_ADDR; do
-   IP_ADDR_OPT=
-   IP_ROUTE_OPT=
-
[ -z $IP_ADDR ]  continue
# Be sure that primary address is added
if [ $IP_ADDR = $IP4ADDR -o $IP_ADDR = $IP6ADDR ]; then
@@ -40,14 +30,10 @@
# Check for IPv6 address
if (echo $IP_ADDR | grep -q :); then
if is_yes ${IPV6_NETWORKING}; then
-   ip -6 addr add ${IP_ADDR} dev ${DEVICE} ${IP_ADDR_OPT}
+   ip -6 addr add ${IP_ADDR} dev ${DEVICE}
fi
elif is_yes ${IPV4_NETWORKING}; then
-   # If broadcast is missing then autocalculate it
-   if ! (echo $IP_ADDR_OPT | grep -qE brd|broadcast); then
-   IP_ADDR_OPT=brd + ${IP_ADDR_OPT}
-   fi
-   ip -4 addr add ${IP_ADDR} dev ${DEVICE} ${IP_ADDR_OPT}
+   ip -4 addr add ${IP_ADDR} dev ${DEVICE} brd +
fi
 done
 
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/ifup-aliases

2009-03-10 Thread baggins
Author: baggins
Date: Tue Mar 10 12:38:00 2009
New Revision: 10197

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/ifup-aliases
Log:
- added addrlabel support


Modified: rc-scripts/trunk/sysconfig/network-scripts/ifup-aliases
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifup-aliases (original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifup-aliases Tue Mar 10 
12:38:00 2009
@@ -43,6 +43,7 @@
 
eval IP_ADDR_OPT=\$IP_AOPTS${nr}
eval IP_ROUTE_OPT=\$IP_ROPTS${nr}
+   eval IP_ADDR_LABEL=\$IP_LABEL${nr}
 
# Be sure that primary address is added
if [ $IP_ADDR = $IP4ADDR -o $IP_ADDR = $IP6ADDR ]; then
@@ -54,6 +55,7 @@
if echo $IP_ADDR | grep -q :; then
if is_yes ${IPV6_NETWORKING}; then
ip -6 addr add ${IP_ADDR} dev ${DEVICE} ${IP_ADDR_OPT}
+   ip -6 addrlabel add prefix ${IP_ADDR} dev ${DEVICE} 
label ${IP_ADDR_LABEL}
fi
elif is_yes ${IPV4_NETWORKING}; then
# If broadcast is missing then autocalculate it
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts: functions.network ifup

2009-03-10 Thread baggins
Author: baggins
Date: Tue Mar 10 12:39:10 2009
New Revision: 10198

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/functions.network
   rc-scripts/trunk/sysconfig/network-scripts/ifup
Log:
- addlabel is IPv6 only


Modified: rc-scripts/trunk/sysconfig/network-scripts/functions.network
==
--- rc-scripts/trunk/sysconfig/network-scripts/functions.network
(original)
+++ rc-scripts/trunk/sysconfig/network-scripts/functions.networkTue Mar 
10 12:39:10 2009
@@ -204,7 +204,6 @@
else
eval IP4ADDROPT=\$IP_AOPTS${IP4_PRIM_IF:-}
eval IP4ROUTEOPT=\$IP_ROPTS${IP4_PRIM_IF:-}
-   eval IP4ADDRLABEL=\$IP_LABEL${IP4_PRIM_IF:-}
fi
if [ ${IP6_PRIM_IF} ] ; then
eval IP6ADDR=\$IPADDR${IP6_PRIM_IF:-}

Modified: rc-scripts/trunk/sysconfig/network-scripts/ifup
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifup (original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifup Tue Mar 10 12:39:10 2009
@@ -191,9 +191,6 @@
else
ip addr add ${IP4ADDR} ${ALIAS} dev ${DEVICE} 
${IP4ADDROPT}
fi
-   if [ -n ${IP4ADDRLABEL} ]; then
-   ip addrlabel add prefix ${IP4ADDR} dev ${DEVICE} label 
${IP4ADDRLABEL}
-   fi
fi
 
# Set device up
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/ifdown-vlan

2009-03-09 Thread glen
Author: glen
Date: Mon Mar  9 19:50:51 2009
New Revision: 10182

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/ifdown-vlan
Log:
- ip link help might be localized, remove unneeded subshell

Modified: rc-scripts/trunk/sysconfig/network-scripts/ifdown-vlan
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifdown-vlan  (original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifdown-vlan  Mon Mar  9 
19:50:51 2009
@@ -39,7 +39,7 @@
 ip link set ${DEVICE} down
 LC_ALL=C ip addr flush dev ${DEVICE} 21 | grep -v Nothing to flush
 
-if (ip link help 21 | grep -q del); then
+if LC_ALL=C ip link help 21 | grep -q del; then
/sbin/ip link del ${DEVICE}
 elif [ -x /sbin/vconfig ]; then
/sbin/vconfig rem ${DEVICE}
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/ifup

2009-03-08 Thread gotar
Author: gotar
Date: Sun Mar  8 16:48:00 2009
New Revision: 10176

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/ifup
Log:
- rc.d/init.d/network calls /sbin/ifup tnlcfg-$i boot causing
awk: cannot open tnlcfg-tun0 (No such file or directory)
  from ifup-post tnlcfg-tun0 (calling ifup-aliases without full $CONFIG path)
  This fixes long lasting bug:
http://www.mail-archive.com/pld-devel...@lists.pld-linux.org/msg18413.html
http://www.mail-archive.com/pld-devel...@lists.pld-linux.org/msg11198.html


Modified: rc-scripts/trunk/sysconfig/network-scripts/ifup
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifup (original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifup Sun Mar  8 16:48:00 2009
@@ -39,6 +39,8 @@
 
 if [ -f /etc/sysconfig/interfaces/ifcfg-$DEV ]; then
CONFIG=/etc/sysconfig/interfaces/ifcfg-$DEV
+elif [ -f /etc/sysconfig/interfaces/$DEV ]; then
+   CONFIG=/etc/sysconfig/interfaces/$DEV
 else
CONFIG=$DEV
 fi
@@ -225,7 +227,7 @@
 if is_yes $ENABLE_6TO4; then
# find an usable IPv4 address for this device; might have been obtained 
by dhcp or ppp
for ipv4 in `/sbin/ip addr show dev $DEVICE | awk -F'[ /]+' '/ inet 
/{print $3}'`; do
-   if [   `ipcalc -n $ipv4/8`  != NETWORK=10.0.0.0\
+   if [   `ipcalc -n $ipv4/8`  != NETWORK=10.0.0.0\
-a `ipcalc -n $ipv4/12` != NETWORK=172.16.0.0  \
-a `ipcalc -n $ipv4/24` != NETWORK=192.168.0.0 \
-a `ipcalc -n $ipv4/24` != NETWORK=169.254.0.0 ]; then
@@ -234,8 +236,8 @@
break
fi
done
-   if [ -n $local_ipv4 ]; then   # we have an usable IPv4 address; set 
up the tunnel
-   tun6to4=tun6to4_$DEVICE 
+   if [ -n $local_ipv4 ]; then   # we have an usable IPv4 address; set 
up the tunnel
+   tun6to4=tun6to4_$DEVICE
/sbin/ip tunnel add $tun6to4 mode sit ttl 128 remote any local 
$local_ipv4
/sbin/ip link set dev $tun6to4 up
/sbin/ip -6 addr  add $local_ipv6/16 dev $tun6to4
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/ifdown-vlan

2009-02-27 Thread gotar
Author: gotar
Date: Fri Feb 27 17:33:36 2009
New Revision: 10149

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/ifdown-vlan
Log:
- restored vconfig support for older iproute2 users


Modified: rc-scripts/trunk/sysconfig/network-scripts/ifdown-vlan
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifdown-vlan  (original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifdown-vlan  Fri Feb 27 
17:33:36 2009
@@ -38,7 +38,16 @@
 
 ip link set ${DEVICE} down
 LC_ALL=C ip addr flush dev ${DEVICE} 21 | grep -v Nothing to flush
-ip link del ${DEVICE}
+
+if (ip link help 21 | grep -q del); then
+   /sbin/ip link del ${DEVICE}
+elif [ -x /sbin/vconfig ]; then
+   /sbin/vconfig rem ${DEVICE}
+else
+   nls /sbin/vconfig or iproute2 with vlan support is missing. Can't 
continue.
+   exit 1
+fi
+
 RESULT=$?
 
 exit $RESULT
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/ifup-vlan

2009-02-27 Thread gotar
Author: gotar
Date: Fri Feb 27 17:36:52 2009
New Revision: 10150

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/ifup-vlan
Log:
- fixed exit status when no appropriate tools found


Modified: rc-scripts/trunk/sysconfig/network-scripts/ifup-vlan
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifup-vlan(original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifup-vlanFri Feb 27 
17:36:52 2009
@@ -69,13 +69,14 @@
# default no
is_yes $VLAN_GVRP  VLAN_GVRP=on || VLAN_GVRP=off
/sbin/ip link set ${DEVICE} type vlan reorder_hdr ${VLAN_REORDER_HDR} 
gvrp ${VLAN_GVRP}
-elif [ -x /sbin/vconfig ] ; then
+elif [ -x /sbin/vconfig ]; then
/sbin/vconfig set_name_type DEV_PLUS_VID_NO_PAD
/sbin/ip link set ${VLAN_DEV} up
/sbin/vconfig add ${VLAN_DEV} ${VLAN_ID}
/sbin/vconfig set_flag ${DEVICE} 1 ${VLAN_REORDER_HDR:-1}
 else
nls /sbin/vconfig or iproute2 with vlan support is missing. Can't 
continue.
+   exit 1
 fi
 RESULT=$?
 
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/ifdown

2009-01-23 Thread glen
Author: glen
Date: Fri Jan 23 14:54:56 2009
New Revision: 10094

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/ifdown
Log:
- grepping pid from ps ax could be ambigous, use kill -0 for running-pid-check

Modified: rc-scripts/trunk/sysconfig/network-scripts/ifdown
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifdown   (original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifdown   Fri Jan 23 14:54:56 2009
@@ -89,7 +89,7 @@
  dhclient)
if [ -f /var/run/dhclient.pid ];then
PID=$(cat /var/run/dhclient.pid)
-   if ps ax --no-header | grep -q $PID; then
+   if kill -0 $PID 2/dev/null; then
kill $PID
RESULT=$?
fi
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/functions.network

2009-01-23 Thread glen
Author: glen
Date: Fri Jan 23 16:03:35 2009
New Revision: 10095

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/functions.network
Log:
- local output for func internal vars

Modified: rc-scripts/trunk/sysconfig/network-scripts/functions.network
==
--- rc-scripts/trunk/sysconfig/network-scripts/functions.network
(original)
+++ rc-scripts/trunk/sysconfig/network-scripts/functions.networkFri Jan 
23 16:03:35 2009
@@ -559,7 +559,7 @@
 check_mii_tool ()
 {
[ -x /sbin/mii-tool ] || return 2
-   output=$(LC_ALL=C mii-tool $1 21)
+   local output=$(LC_ALL=C mii-tool $1 21)
echo $output | grep -q link ok  return 1
echo $output | grep -q no link  return 0
return 2
@@ -572,7 +572,7 @@
 check_ethtool ()
 {
[ -x /sbin/ethtool ] || return 2
-   output=$(LC_ALL=C ethtool $1 21)
+   local output=$(LC_ALL=C ethtool $1 21)
echo $output | grep -q Link detected: yes  return 1
echo $output | grep -q Link detected: no  return 0
return 2
@@ -585,7 +585,7 @@
 check_iwconfig ()
 {
[ -x /sbin/iwconfig ] || return 2
-   output=$(LC_ALL=C iwconfig $1 21)
+   local output=$(LC_ALL=C iwconfig $1 21)
echo $output | grep -q radio off  return 0
# XXX why no 'radio on' check?
return 2
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/ifdown-vlan

2009-01-22 Thread arekm
Author: arekm
Date: Thu Jan 22 09:41:36 2009
New Revision: 10086

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/ifdown-vlan
Log:
vconfig no longer needed here.

Modified: rc-scripts/trunk/sysconfig/network-scripts/ifdown-vlan
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifdown-vlan  (original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifdown-vlan  Thu Jan 22 
09:41:36 2009
@@ -33,11 +33,6 @@
exit 0
 fi
 
-if [ ! -x /sbin/vconfig ]; then
-   nls %s is missing. Can't continue. /sbin/vconfig
-   exit 1
-fi
-
 # set all major variables
 setup_ip_param
 
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/ifdown

2009-01-22 Thread arekm
Author: arekm
Date: Thu Jan 22 09:56:24 2009
New Revision: 10087

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/ifdown
Log:
No need for special handling for vlans when downing master device.

Modified: rc-scripts/trunk/sysconfig/network-scripts/ifdown
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifdown   (original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifdown   Thu Jan 22 09:56:24 2009
@@ -107,51 +107,30 @@
 # Check to make sure the device is actually up
 check_device_down  exit 0
 
-vlan_setup
-if is_yes $ETH_VLANS  $(echo $DEVICE | grep -q ^eth) ; then
-   if echo ${DEVICE} | grep -q '\.' ; then
-   # vlan down
-   ip addr flush dev ${DEVICE} 21 | grep -v Nothing to flush
-   ip link set ${DEVICE} down
-   ip link del ${DEVICE} 21  /dev/null
-   else
-   # downujemy interfejs nadrzedny do vlanow
-   for VLANDEVICE in $(ls /proc/net/vlan 2 /dev/null | grep 
^${DEVICE}) ; do
-   # najpierw wszystkie vlany po kolei
-   ip addr flush dev ${VLANDEVICE} 21 | grep -v Nothing 
to flush
-   ip link set ${VLANDEVICE} down
-   ip link del ${VLANDEVICE} 21  /dev/null
-   done
-   # a potem dopiero interfejs nadrzedny
-   ip addr flush dev ${DEVICE} 21 | grep -v Nothing to flush
-   ip link set ${DEVICE} down
-   fi
+if [ -n ${SUBDEVICE} ]; then
+   ip addr del ${IP4ADDR} label ${SUBDEVICE} dev ${DEVICE}
 else
-   if [ -n ${SUBDEVICE} ]; then
-   ip addr del ${IP4ADDR} label ${SUBDEVICE} dev ${DEVICE}
-   else
-   ip addr flush dev ${DEVICE} 21 | grep -v Nothing to flush
-
-   if [ ${DEVICETYPE} = bond ]; then
-   if [ ! -x /sbin/ifenslave ]; then
-   nls %s is missing. Can't continue. 
/sbin/ifenslave
-   exit 1
-   fi
+   ip addr flush dev ${DEVICE} 21 | grep -v Nothing to flush
 
-   # get up the bonding device before enslaving
-   if ! check_device_down ${DEVICE}; then
-   ip link set ${DEVICE} up
-   fi
+   if [ ${DEVICETYPE} = bond ]; then
+   if [ ! -x /sbin/ifenslave ]; then
+   nls %s is missing. Can't continue. /sbin/ifenslave
+   exit 1
+   fi
 
-   for BSVAR in $(awk '/Slave Interface:/{ print $3}' 
/proc/net/bonding/${DEVICE}); do
-   if [ ${BSVAR} ]; then
-   ifenslave -d ${DEVICE} $BSVAR
-   fi
-   done
+   # get up the bonding device before enslaving
+   if ! check_device_down ${DEVICE}; then
+   ip link set ${DEVICE} up
fi
 
-   ip link set ${DEVICE} down
+   for BSVAR in $(awk '/Slave Interface:/{ print $3}' 
/proc/net/bonding/${DEVICE}); do
+   if [ ${BSVAR} ]; then
+   ifenslave -d ${DEVICE} $BSVAR
+   fi
+   done
fi
+
+   ip link set ${DEVICE} down
 fi
 
 if [ $HANDLING = 4 ]; then
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts: functions.network ifup-vlan

2009-01-22 Thread arekm
Author: arekm
Date: Thu Jan 22 09:56:42 2009
New Revision: 10088

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/functions.network
   rc-scripts/trunk/sysconfig/network-scripts/ifup-vlan
Log:
Prefer vlan creation using iproute2, fallback to vconfig.

Modified: rc-scripts/trunk/sysconfig/network-scripts/functions.network
==
--- rc-scripts/trunk/sysconfig/network-scripts/functions.network
(original)
+++ rc-scripts/trunk/sysconfig/network-scripts/functions.networkThu Jan 
22 09:56:42 2009
@@ -174,16 +174,6 @@
fi
 }
 
-vlan_setup()
-{
-   if [ -x /sbin/vconfig -a -e /proc/net/vlan/config ]  echo $DEVICE | 
grep -q ^eth; then
-   /sbin/vconfig set_name_type DEV_PLUS_VID_NO_PAD 21  /dev/null
-   ETH_VLANS=yes
-   else
-   ETH_VLANS=no
-   fi
-}
-
 # Set up all IP  IP parameter variables
 setup_ip_param ()
 {

Modified: rc-scripts/trunk/sysconfig/network-scripts/ifup-vlan
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifup-vlan(original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifup-vlanThu Jan 22 
09:56:42 2009
@@ -51,11 +51,6 @@
exit 1
 fi
 
-if [ ! -x /sbin/vconfig ]; then
-   nls %s is missing. Can't continue. /sbin/vconfig
-   exit 1
-fi
-
 modprobe -s -k 8021q
 
 if [ ! -e /proc/net/vlan/config ]; then
@@ -66,10 +61,22 @@
 # set all major variables
 setup_ip_param
 
-/sbin/vconfig set_name_type DEV_PLUS_VID_NO_PAD
-/sbin/ip link set ${VLAN_DEV} up
-/sbin/vconfig add ${VLAN_DEV} ${VLAN_ID}
-/sbin/vconfig set_flag ${DEVICE} 1 ${VLAN_REORDER_HDR:-1}
+if (ip link add type vlan help 21 | grep -q VLANID :=); then
+   /sbin/ip link set ${VLAN_DEV} up
+   /sbin/ip link add link ${VLAN_DEV} name ${DEVICE} type vlan id 
${VLAN_ID}
+   # default yes
+   is_no ${VLAN_REORDER_HDR}  VLAN_REORDER_HDR=off || 
VLAN_REORDER_HDR=on
+   # default no
+   is_yes $VLAN_GVRP  VLAN_GVRP=on || VLAN_GVRP=off
+   /sbin/ip link set ${DEVICE} type vlan reorder_hdr ${VLAN_REORDER_HDR} 
gvrp ${VLAN_GVRP}
+elif [ -x /sbin/vconfig ] ; then
+   /sbin/vconfig set_name_type DEV_PLUS_VID_NO_PAD
+   /sbin/ip link set ${VLAN_DEV} up
+   /sbin/vconfig add ${VLAN_DEV} ${VLAN_ID}
+   /sbin/vconfig set_flag ${DEVICE} 1 ${VLAN_REORDER_HDR:-1}
+else
+   nls /sbin/vconfig or iproute2 with vlan support is missing. Can't 
continue.
+fi
 RESULT=$?
 
 # XXX: more VLAN specific options support
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts: ifdown ifdown-vlan

2009-01-21 Thread arekm
Author: arekm
Date: Thu Jan 22 08:43:57 2009
New Revision: 10085

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/ifdown
   rc-scripts/trunk/sysconfig/network-scripts/ifdown-vlan
Log:
Delete devices using iproute2.

Modified: rc-scripts/trunk/sysconfig/network-scripts/ifdown
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifdown   (original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifdown   Thu Jan 22 08:43:57 2009
@@ -113,14 +113,14 @@
# vlan down
ip addr flush dev ${DEVICE} 21 | grep -v Nothing to flush
ip link set ${DEVICE} down
-   /sbin/vconfig rem ${DEVICE} 21  /dev/null
+   ip link del ${DEVICE} 21  /dev/null
else
# downujemy interfejs nadrzedny do vlanow
for VLANDEVICE in $(ls /proc/net/vlan 2 /dev/null | grep 
^${DEVICE}) ; do
# najpierw wszystkie vlany po kolei
ip addr flush dev ${VLANDEVICE} 21 | grep -v Nothing 
to flush
ip link set ${VLANDEVICE} down
-   /sbin/vconfig rem ${VLANDEVICE} 21  /dev/null
+   ip link del ${VLANDEVICE} 21  /dev/null
done
# a potem dopiero interfejs nadrzedny
ip addr flush dev ${DEVICE} 21 | grep -v Nothing to flush

Modified: rc-scripts/trunk/sysconfig/network-scripts/ifdown-vlan
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifdown-vlan  (original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifdown-vlan  Thu Jan 22 
08:43:57 2009
@@ -43,7 +43,7 @@
 
 ip link set ${DEVICE} down
 ip addr flush dev ${DEVICE} 21 | grep -v Nothing to flush
-/sbin/vconfig rem ${DEVICE}
+ip link del ${DEVICE}
 RESULT=$?
 
 exit $RESULT
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/ifup-vlan

2008-11-30 Thread arekm
Author: arekm
Date: Sun Nov 30 20:27:58 2008
New Revision: 10016

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/ifup-vlan
Log:
Load 8021q module.

Modified: rc-scripts/trunk/sysconfig/network-scripts/ifup-vlan
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifup-vlan(original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifup-vlanSun Nov 30 
20:27:58 2008
@@ -56,6 +56,8 @@
exit 1
 fi
 
+modprobe -s -k 8021q
+
 if [ ! -e /proc/net/vlan/config ]; then
nls VLAN kernel support is missing. Can't continue.
exit 1
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/ifup

2008-10-25 Thread radek
Author: radek
Date: Sat Oct 25 20:35:07 2008
New Revision: 9920

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/ifup
Log:
- removed sed dependency

Modified: rc-scripts/trunk/sysconfig/network-scripts/ifup
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifup (original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifup Sat Oct 25 20:35:07 2008
@@ -218,7 +218,7 @@
 
 if is_yes $ENABLE_6TO4; then
# find an usable IPv4 address for this device; might have been obtained 
by dhcp or ppp
-   for ipv4 in `/sbin/ip addr show dev $DEVICE | awk '/ inet /{print $2}' 
| sed -e 's,/.*,,'`; do
+   for ipv4 in `/sbin/ip addr show dev $DEVICE | awk -F'[ /]+' '/ inet 
/{print $3}'`; do
if [   `ipcalc -n $ipv4/8`  != NETWORK=10.0.0.0\
-a `ipcalc -n $ipv4/12` != NETWORK=172.16.0.0  \
-a `ipcalc -n $ipv4/24` != NETWORK=192.168.0.0 \
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts: ifdown ifup

2008-10-25 Thread undefine
Author: undefine
Date: Sun Oct 26 00:53:23 2008
New Revision: 9921

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/ifdown
   rc-scripts/trunk/sysconfig/network-scripts/ifup
Log:
- wpa is also usefull with not wireless devices - eg with 8021x.
- patch by Pawel Nogas pnogas(AT)amu(DOT)edu(DOT)pl


Modified: rc-scripts/trunk/sysconfig/network-scripts/ifdown
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifdown   (original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifdown   Sun Oct 26 00:53:23 2008
@@ -99,11 +99,9 @@
fi
 fi
 
-if is_wireless_device ${DEVICE}; then
-   if is_yes ${WLAN_WPA}; then
-   killproc --pidfile wpa_supplicant-${DEVICE}.pid 
wpa_supplicant  /dev/null 21
-   rm -f /var/run/wpa_supplicant-${DEVICE}.pid
-   fi
+if is_yes ${WLAN_WPA}; then
+   killproc --pidfile wpa_supplicant-${DEVICE}.pid wpa_supplicant  
/dev/null 21
+   rm -f /var/run/wpa_supplicant-${DEVICE}.pid
 fi
 
 # Check to make sure the device is actually up

Modified: rc-scripts/trunk/sysconfig/network-scripts/ifup
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifup (original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifup Sun Oct 26 00:53:23 2008
@@ -113,9 +113,10 @@
 if is_wireless_device ${DEVICE}; then
is_yes ${WLAN_UPEARLY}  ip link set ${DEVICE} up
wireless_param ${DEVICE}
-   if is_yes ${WLAN_WPA}; then
-   /usr/sbin/wpa_supplicant -D ${WLAN_WPA_DRIVER} -c 
${WLAN_WPA_CONFIG:-/etc/wpa_supplicant.conf} -i ${DEVICE} ${WLAN_WPA_OPTIONS} 
-P /var/run/wpa_supplicant-${DEVICE}.pid -B
-   fi
+fi
+
+if is_yes ${WLAN_WPA}; then
+   /usr/sbin/wpa_supplicant -D ${WLAN_WPA_DRIVER} -c 
${WLAN_WPA_CONFIG:-/etc/wpa_supplicant.conf} -i ${DEVICE} ${WLAN_WPA_OPTIONS} 
-P /var/run/wpa_supplicant-${DEVICE}.pid -B
 fi
 
 if [ $HANDLING = 2 ]; then
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/ifup

2008-07-17 Thread shadzik
Author: shadzik
Date: Thu Jul 17 22:42:44 2008
New Revision: 9846

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/ifup
Log:
- wpa_supplicant 0.6.3 doesn't have a -w option!!


Modified: rc-scripts/trunk/sysconfig/network-scripts/ifup
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifup (original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifup Thu Jul 17 22:42:44 2008
@@ -114,7 +114,7 @@
is_yes ${WLAN_UPEARLY}  ip link set ${DEVICE} up
wireless_param ${DEVICE}
if is_yes ${WLAN_WPA}; then
-   /usr/sbin/wpa_supplicant -w -D ${WLAN_WPA_DRIVER} -c 
${WLAN_WPA_CONFIG:-/etc/wpa_supplicant.conf} -i ${DEVICE} ${WLAN_WPA_OPTIONS} 
-P /var/run/wpa_supplicant-${DEVICE}.pid -B
+   /usr/sbin/wpa_supplicant -D ${WLAN_WPA_DRIVER} -c 
${WLAN_WPA_CONFIG:-/etc/wpa_supplicant.conf} -i ${DEVICE} ${WLAN_WPA_OPTIONS} 
-P /var/run/wpa_supplicant-${DEVICE}.pid -B
fi
 fi
 
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/ifup-ppp

2008-06-10 Thread blues
Author: blues
Date: Tue Jun 10 23:00:17 2008
New Revision: 9801

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/ifup-ppp
Log:
- try last resort in setting MODEMPORT - compatibility change.


Modified: rc-scripts/trunk/sysconfig/network-scripts/ifup-ppp
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifup-ppp (original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifup-ppp Tue Jun 10 23:00:17 2008
@@ -138,8 +138,13 @@
 fi
 
 if [ -z $MODEMPORT ]; then
-   echo 2 Missing modemport!
-   exit 1
+   # Last try:
+   if [ ${PPPOA_VPI} -a ${PPPOA_VCI} ]; then
+   MODEMPORT=${PPPOA_VPI}.${PPPOA_VCI}
+   else
+   echo 2 Missing modemport!
+   exit 1
+   fi
 fi
 
 if [ -z $HOLDOFF ]; then
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/ifdown

2008-05-22 Thread arekm
Author: arekm
Date: Thu May 22 21:08:32 2008
New Revision: 9761

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/ifdown
Log:
Return can be only from function. Use exit.

Modified: rc-scripts/trunk/sysconfig/network-scripts/ifdown
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifdown   (original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifdown   Thu May 22 21:08:32 2008
@@ -153,7 +153,7 @@
 
 if [ -n $RESULT ] ; then
if [ $RESULT -ne 0 ]; then
-   return $RESULT
+   exit $RESULT
fi
 fi
 
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/ifup-ppp

2008-03-26 Thread paszczus
Author: paszczus
Date: Wed Mar 26 09:46:17 2008
New Revision: 9680

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/ifup-ppp
Log:
- sync option must be used before plugin option
- changes made by seba (at) pro-ject.net (merged from cvs)


Modified: rc-scripts/trunk/sysconfig/network-scripts/ifup-ppp
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifup-ppp (original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifup-ppp Wed Mar 26 09:46:17 2008
@@ -163,6 +163,9 @@
 if is_yes ${MODEMCTL}; then
opts=$opts modem
 fi
+if is_yes ${SYNC}; then
+   opts=$opts sync
+fi
 if is_yes ${ESCAPECHARS}; then
opts=$opts asyncmap 
 else
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network

2008-03-26 Thread glen
Author: glen
Date: Wed Mar 26 15:42:51 2008
New Revision: 9681

Modified:
   rc-scripts/trunk/sysconfig/network
Log:
- i always set full hostname here, why only hostname comment?

Modified: rc-scripts/trunk/sysconfig/network
==
--- rc-scripts/trunk/sysconfig/network  (original)
+++ rc-scripts/trunk/sysconfig/network  Wed Mar 26 15:42:51 2008
@@ -11,7 +11,7 @@
 # Do you want IPv4 forwarding ?
 # then set it in /etc/sysctl.conf
 
-# Set hostname here (only hostname)
+# Set hostname here
 HOSTNAME=pldmachine
 
 # Allow udev to create /etc/sysconfig/interfaces/ifcfg-* automatically?
@@ -58,6 +58,3 @@
 # Specify interface on which you want to enable tleds software
 # (also you need tleds package installed) -- default set to no
 TLEDS_DEV=no
-
-# This must be last line !
-# vi:syntax=sh
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/ifup-ppp

2008-03-25 Thread glen
Author: glen
Date: Tue Mar 25 16:11:27 2008
New Revision: 9670

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/ifup-ppp
Log:
- check $MODEMPORT set from config (not the value set from this script)

Modified: rc-scripts/trunk/sysconfig/network-scripts/ifup-ppp
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifup-ppp (original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifup-ppp Tue Mar 25 16:11:27 2008
@@ -49,6 +49,11 @@
REPORTFILE=/dev/null
 fi
 
+if [ -n $MODEMPORT -a ! -c $MODEMPORT ]; then
+   echo 2 MODEMPORT=$MODEMPORT is not a character device!
+   exit 1
+fi
+
 if [ -n ${PPPOE_DEV} ]; then
if is_yes ${PPPOE_KERNEL}; then
modprobe -s -k pppoe
@@ -136,11 +141,6 @@
exit 1
 fi
 
-if [ ! -c $MODEMPORT ]; then
-   echo 2 MODEMPORT=$MODEMPORT is not a character device!
-   exit 1
-fi
-
 if [ -z $HOLDOFF ]; then
HOLDOFF=30
 fi
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/ifup-ppp

2008-03-25 Thread glen
Author: glen
Date: Tue Mar 25 16:14:16 2008
New Revision: 9671

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/ifup-ppp
Log:
- actually check $MODEMPORT being chardevice after all *DSL variants

Modified: rc-scripts/trunk/sysconfig/network-scripts/ifup-ppp
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifup-ppp (original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifup-ppp Tue Mar 25 16:14:16 2008
@@ -49,11 +49,6 @@
REPORTFILE=/dev/null
 fi
 
-if [ -n $MODEMPORT -a ! -c $MODEMPORT ]; then
-   echo 2 MODEMPORT=$MODEMPORT is not a character device!
-   exit 1
-fi
-
 if [ -n ${PPPOE_DEV} ]; then
if is_yes ${PPPOE_KERNEL}; then
modprobe -s -k pppoe
@@ -100,6 +95,12 @@
MODEMMODE=plugin pppoatm.so
MODEMPORT=${PPPOA_VPI}.${PPPOA_VCI}
 else
+
+   if [ -n $MODEMPORT -a ! -c $MODEMPORT ]; then
+   echo 2 MODEMPORT=$MODEMPORT is not a character device!
+   exit 1
+   fi
+
if is_no ${DIRECT_CONNECT} || [ -z ${DIRECT_CONNECT} ]; then
PEERCONF=/etc/ppp/peers/${DEVNAME}
if [ ! -f ${PEERCONF} ]; then
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/functions.network

2008-03-24 Thread glen
Author: glen
Date: Mon Mar 24 20:16:03 2008
New Revision: 9667

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/functions.network
Log:
- return val doc for check_{mii_tool,ethtool,iwconfig}
- code readability

Modified: rc-scripts/trunk/sysconfig/network-scripts/functions.network
==
--- rc-scripts/trunk/sysconfig/network-scripts/functions.network
(original)
+++ rc-scripts/trunk/sysconfig/network-scripts/functions.networkMon Mar 
24 20:16:03 2008
@@ -41,7 +41,7 @@
 {
# Notify programs that have requested notification
( cd /var/run/netreport || exit
-   for i in * ; do
+   for i in *; do
[ -f $i ]  kill -SIGIO $i /dev/null 21 || \
rm -f $i /dev/null 21
done
@@ -51,8 +51,7 @@
 need_hostname()
 {
local hostname=$(hostname)
-   if [ $hostname = (none) -o $hostname = localhost -o \
-$hostname = localhost.localdomain ]; then
+   if [ $hostname = (none) -o $hostname = localhost -o $hostname 
= localhost.localdomain ]; then
NEEDHOSTNAME=yes
else
unset NEEDHOSTNAME
@@ -72,7 +71,8 @@
fi
 
if [ $domain ]; then
-   /etc/resolv.conf.new
+   # XXX umask and possible /etc/resolv.conf symlink breakage
+/etc/resolv.conf.new
if ! grep -q search $domain /etc/resolv.conf ; then
echo search $domain  /etc/resolv.conf.new
fi
@@ -562,28 +562,48 @@
fi
 }
 
+# returns
+# 0 - no link
+# 1 - link ok
+# 2 - unsupported, unknown return
 check_mii_tool ()
 {
[ -x /sbin/mii-tool ] || return 2
output=$(LC_ALL=C mii-tool $1 21)
echo $output | grep -q link ok  return 1
-   echo $output | grep -q no link  return 0 || return 2
+   echo $output | grep -q no link  return 0
+   return 2
 }
 
+# returns
+# 0 - link off
+# 1 - link on
+# 2 - unsupported, unknown return
 check_ethtool ()
 {
[ -x /sbin/ethtool ] || return 2
output=$(LC_ALL=C ethtool $1 21)
echo $output | grep -q Link detected: yes  return 1
-   echo $output | grep -q Link detected: no  return 0 || return 2
+   echo $output | grep -q Link detected: no  return 0
+   return 2
 }
 
+# returns
+# 0 - radio off
+# 1 - radio on
+# 2 - unsupported
 check_iwconfig ()
 {
[ -x /sbin/iwconfig ] || return 2
-   LC_ALL=C iwconfig $1 21 | grep -q radio off  return 0 || return 
2
+   output=$(LC_ALL=C iwconfig $1 21)
+   echo $output | grep -q radio off  return 0
+   # XXX why no 'radio on' check?
+   return 2
 }
 
+# returns
+# 0 - link down
+# 1 - link up
 check_link_down ()
 {
if [ -x /sbin/mii-tool -o -x /sbin/ethtool -o -x /sbin/iwconfig ]; then
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts: ifdown ifup

2008-02-27 Thread glen
Author: glen
Date: Wed Feb 27 11:35:37 2008
New Revision: 9533

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/ifdown
   rc-scripts/trunk/sysconfig/network-scripts/ifup
Log:
- fix for network script that it does not enslave eth interfaces from it during 
stop phase (Ilja Bobkevi�)

Modified: rc-scripts/trunk/sysconfig/network-scripts/ifdown
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifdown   (original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifdown   Wed Feb 27 11:35:37 2008
@@ -124,6 +124,25 @@
ip addr del ${IP4ADDR} label ${SUBDEVICE} dev ${DEVICE}
else
ip addr flush dev ${DEVICE} 21 | grep -v Nothing to flush
+
+   if [ ${DEVICETYPE} = bond ]; then
+   if [ ! -x /sbin/ifenslave ]; then
+   nls %s is missing. Can't continue. 
/sbin/ifenslave
+   exit 1
+   fi
+
+   # get up the bonding device before enslaving
+   if ! check_device_down ${DEVICE}; then
+   ip link set ${DEVICE} up
+   fi
+
+   for BSVAR in $(awk '/Slave Interface:/{ print $3}' 
/proc/net/bonding/${DEVICE}); do
+   if [ ${BSVAR} ]; then
+   ifenslave -d ${DEVICE} $BSVAR
+   fi
+   done
+   fi
+
ip link set ${DEVICE} down
fi
 fi

Modified: rc-scripts/trunk/sysconfig/network-scripts/ifup
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifup (original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifup Wed Feb 27 11:35:37 2008
@@ -81,6 +81,11 @@
exit 1
 fi
 
+if is_yes $SLAVE  [ ! -x /sbin/ifenslave ]; then
+   nls %s is missing. Can't continue. /sbin/ifenslave
+   exit 1
+fi
+
 if is_yes $SLAVE  [ -n $MASTER -a -x /sbin/ifenslave ]; then
RFLAG=  is_yes ${RECIEVE-ONLY}  RFLAG=-r
 
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/ifup-ppp

2008-02-18 Thread glen
Author: glen
Date: Mon Feb 18 21:56:16 2008
New Revision: 9424

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/ifup-ppp
Log:
- require $MODEMPORT being character device (/dev/modem, /dev/tts/USB0)

Modified: rc-scripts/trunk/sysconfig/network-scripts/ifup-ppp
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifup-ppp (original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifup-ppp Mon Feb 18 21:56:16 2008
@@ -136,6 +136,11 @@
exit 1
 fi
 
+if [ ! -c $MODEMPORT ]; then
+   echo 2 MODEMPORT=$MODEMPORT is not a character device!
+   exit 1
+fi
+
 if [ -z $HOLDOFF ]; then
HOLDOFF=30
 fi
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/ifup-ppp

2008-02-09 Thread glen
Author: glen
Date: Sat Feb  9 21:00:53 2008
New Revision: 9279

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/ifup-ppp
Log:
- fail on required MODEMPORT (or set it to /dev/modem?)

Modified: rc-scripts/trunk/sysconfig/network-scripts/ifup-ppp
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifup-ppp (original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifup-ppp Sat Feb  9 21:00:53 2008
@@ -131,6 +131,11 @@
fi
 fi
 
+if [ -z $MODEMPORT ]; then
+   echo 2 Missing modemport!
+   exit 1
+fi
+
 if [ -z $HOLDOFF ]; then
HOLDOFF=30
 fi
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/ifup-ppp

2008-02-08 Thread glen
Author: glen
Date: Fri Feb  8 16:39:32 2008
New Revision: 9237

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/ifup-ppp
Log:
- give hint on missing chatscript error

Modified: rc-scripts/trunk/sysconfig/network-scripts/ifup-ppp
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifup-ppp (original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifup-ppp Fri Feb  8 16:39:32 2008
@@ -102,7 +102,7 @@
# XXX: REPORTFILE support is problematic here 
--misiek
[ -f ${CHATSCRIPT} ] || 
CHATSCRIPT=/etc/sysconfig/interfaces/data/chat-${PARENTDEVNAME}
if [ ! -f ${CHATSCRIPT} ]; then
-   nls '%s does not exist' ${CHATSCRIPT}
+   nls '%s does not exist, perhaps set 
$CHATSCRIPT' ${CHATSCRIPT}
nls 'ifup-ppp for %s exiting' 
${DEVNAME}
logger -p daemon.info -t ifup-ppp \
$(nls '%s does not exist for 
%s' ${CHATSCRIPT} ${DEVICE})
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/ifup-ppp

2008-02-08 Thread glen
Author: glen
Date: Fri Feb  8 23:58:22 2008
New Revision: 9254

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/ifup-ppp
Log:
- typo

Modified: rc-scripts/trunk/sysconfig/network-scripts/ifup-ppp
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifup-ppp (original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifup-ppp Fri Feb  8 23:58:22 2008
@@ -5,7 +5,7 @@
 # ifup-ppp script for pppd-2.3.5 (with persist  demand options) ver 0.2
 # Grzegorz Stanislawski [EMAIL PROTECTED]
 # Features:
-#  - since persist option is included to pppd it''s no need to do werid loops
+#  - since persist option is included to pppd it's no need to do werid loops
 #ifup-ppp script. This also makes your logfile grow slower when Your link
 #is down.
 #  - chat-ppp? file with script for chat is now parsed by shell, so You can
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/functions.network

2007-12-08 Thread glen
Author: glen
Date: Sat Dec  8 14:01:17 2007
New Revision: 9130

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/functions.network
Log:
- minor cosetics

Modified: rc-scripts/trunk/sysconfig/network-scripts/functions.network
==
--- rc-scripts/trunk/sysconfig/network-scripts/functions.network
(original)
+++ rc-scripts/trunk/sysconfig/network-scripts/functions.networkSat Dec 
 8 14:01:17 2007
@@ -98,7 +98,7 @@
elif [ -x /sbin/pump ]; then
DHCP_CLIENT=/sbin/pump
else
-   nls Can't find a dhcp client.
+   nls Can't find a DHCP client.
exit 1
fi
fi
@@ -176,7 +176,7 @@
 
 vlan_setup()
 {
-   if [ -x /sbin/vconfig -a -e /proc/net/vlan/config ]  $(echo $DEVICE | 
grep -q ^eth); then
+   if [ -x /sbin/vconfig -a -e /proc/net/vlan/config ]  echo $DEVICE | 
grep -q ^eth; then
/sbin/vconfig set_name_type DEV_PLUS_VID_NO_PAD 21  /dev/null
ETH_VLANS=yes
else
@@ -193,12 +193,12 @@
fi
 
# Setup DEVICETYPE for special cases.
-   if (echo ${DEVICE} | LC_ALL=C egrep -q '^[a-z0-9]+\.[0-9]+$'); then
+   if echo ${DEVICE} | LC_ALL=C egrep -q '^[a-z0-9]+\.[0-9]+$'; then
DEVICETYPE=vlan
fi
 
# real name of device (ie. is eth0 for eth0,eth0:1,eth0:alias)
-   SUBDEVICE=$(echo $DEVICE | egrep ([0-9]+:[0-9]+) )
+   SUBDEVICE=$(echo $DEVICE | egrep ([0-9]+:[0-9]+))
DEVICE=$(echo $DEVICE | awk ' { gsub(/:.*$/,NUL); print $0 } ')
 
eval IP4ADDR=\$IPADDR${IP4_PRIM_IF:-}
@@ -266,7 +266,7 @@
 
 check_device_down ()
 {
-   if (ip link show dev ${DEVICE} 2 /dev/null | grep -q UP); then
+   if LC_ALL=C ip link show dev ${DEVICE} 2 /dev/null | grep -q UP; then
return 1
else
return 0
@@ -349,7 +349,7 @@
 
 set_down_loopback()
 {
-   ip addr flush dev lo 21 | grep -v Nothing to flush
+   LC_ALL=C ip addr flush dev lo 21 | grep -v Nothing to flush
ip link set dev lo down
 }
 
@@ -581,8 +581,7 @@
 check_iwconfig ()
 {
[ -x /sbin/iwconfig ] || return 2
-   output=$(LC_ALL=C iwconfig $1 21)
-   echo $output | grep -q radio off  return 0 || return 2
+   LC_ALL=C iwconfig $1 21 | grep -q radio off  return 0 || return 
2
 }
 
 check_link_down ()
@@ -612,6 +611,3 @@
fi
return 1
 }
-
-# This must be last line !
-# vi:syntax=sh
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts: functions.network ifdown ifup

2007-11-26 Thread glen
Author: glen
Date: Mon Nov 26 21:37:27 2007
New Revision: 9102

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/functions.network
   rc-scripts/trunk/sysconfig/network-scripts/ifdown
   rc-scripts/trunk/sysconfig/network-scripts/ifup
Log:
- apply SOURCES/rc-scripts-dev_alias.patch
  (if it is buggy then the bugs should be fixed -- it's been applied in pld ac 
for ages)

Modified: rc-scripts/trunk/sysconfig/network-scripts/functions.network
==
--- rc-scripts/trunk/sysconfig/network-scripts/functions.network
(original)
+++ rc-scripts/trunk/sysconfig/network-scripts/functions.networkMon Nov 
26 21:37:27 2007
@@ -189,7 +189,7 @@
 {
# detect network device type (ie. dummy, eth for dummy0, eth0 ..)
if [ -z $DEVICETYPE ]; then
-   DEVICETYPE=$(echo $DEVICE | awk ' { 
gsub(/[0-9]*\.?[0-9]*$/,NUL); print $0 } ')
+   DEVICETYPE=$(echo $DEVICE | awk ' { 
gsub(/[\.:]?[0-9]*[\.:]?[0-9]*$/,NUL); print $0 } ')
fi
 
# Setup DEVICETYPE for special cases.
@@ -198,6 +198,7 @@
fi
 
# real name of device (ie. is eth0 for eth0,eth0:1,eth0:alias)
+   SUBDEVICE=$(echo $DEVICE | egrep ([0-9]+:[0-9]+) )
DEVICE=$(echo $DEVICE | awk ' { gsub(/:.*$/,NUL); print $0 } ')
 
eval IP4ADDR=\$IPADDR${IP4_PRIM_IF:-}

Modified: rc-scripts/trunk/sysconfig/network-scripts/ifdown
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifdown   (original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifdown   Mon Nov 26 21:37:27 2007
@@ -120,8 +120,12 @@
ip link set ${DEVICE} down
fi
 else
-   ip addr flush dev ${DEVICE} 21 | grep -v Nothing to flush
-   ip link set ${DEVICE} down
+   if [ -n ${SUBDEVICE} ]; then
+   ip addr del ${IP4ADDR} label ${SUBDEVICE} dev ${DEVICE}
+   else
+   ip addr flush dev ${DEVICE} 21 | grep -v Nothing to flush
+   ip link set ${DEVICE} down
+   fi
 fi
 
 if [ $HANDLING = 4 ]; then

Modified: rc-scripts/trunk/sysconfig/network-scripts/ifup
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifup (original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifup Mon Nov 26 21:37:27 2007
@@ -169,10 +169,14 @@
IP4ADDROPT=brd + ${IP4ADDROPT}
fi
 
+   if [ -n ${SUBDEVICE} ]; then
+   ALIAS=label ${SUBDEVICE}
+   fi
+
if [ -n $REMIP ]; then
-   ip addr add ${IP4ADDR} peer ${REMIP} dev ${DEVICE} 
${IP4ADDROPT}
+   ip addr add ${IP4ADDR} peer ${REMIP} ${ALIAS} dev 
${DEVICE} ${IP4ADDROPT}
else
-   ip addr add ${IP4ADDR} dev ${DEVICE} ${IP4ADDROPT}
+   ip addr add ${IP4ADDR} ${ALIAS} dev ${DEVICE} 
${IP4ADDROPT}
fi
fi
 
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/ifup

2007-10-29 Thread glen
Author: glen
Date: Mon Oct 29 12:29:51 2007
New Revision: 8897

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/ifup
Log:
- assume default WLAN_WPA_CONFIG=/etc/wpa_supplicant.conf

Modified: rc-scripts/trunk/sysconfig/network-scripts/ifup
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifup (original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifup Mon Oct 29 12:29:51 2007
@@ -109,7 +109,7 @@
is_yes ${WLAN_UPEARLY}  ip link set ${DEVICE} up
wireless_param ${DEVICE}
if is_yes ${WLAN_WPA}; then
-   /usr/sbin/wpa_supplicant -B -w -D ${WLAN_WPA_DRIVER} -c 
${WLAN_WPA_CONFIG} -i ${DEVICE} ${WLAN_WPA_OPTIONS} -P 
/var/run/wpa_supplicant-${DEVICE}.pid
+   /usr/sbin/wpa_supplicant -w -D ${WLAN_WPA_DRIVER} -c 
${WLAN_WPA_CONFIG:-/etc/wpa_supplicant.conf} -i ${DEVICE} ${WLAN_WPA_OPTIONS} 
-P /var/run/wpa_supplicant-${DEVICE}.pid -B
fi
 fi
 
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/functions.network

2007-10-28 Thread glen
Author: glen
Date: Sun Oct 28 17:13:04 2007
New Revision: 8884

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/functions.network
Log:
- no need for LC_ALL=C to grep fixed string

Modified: rc-scripts/trunk/sysconfig/network-scripts/functions.network
==
--- rc-scripts/trunk/sysconfig/network-scripts/functions.network
(original)
+++ rc-scripts/trunk/sysconfig/network-scripts/functions.networkSun Oct 
28 17:13:04 2007
@@ -540,23 +540,23 @@
 {
[ -x /sbin/mii-tool ] || return 2
output=$(LC_ALL=C mii-tool $1 21)
-   echo $output | LC_ALL=C grep -q link ok  return 1
-   echo $output | LC_ALL=C grep -q no link  return 0 || return 2
+   echo $output | grep -q link ok  return 1
+   echo $output | grep -q no link  return 0 || return 2
 }
 
 check_ethtool ()
 {
[ -x /sbin/ethtool ] || return 2
output=$(LC_ALL=C ethtool $1 21)
-   echo $output | LC_ALL=C grep -q Link detected: yes  return 1
-   echo $output | LC_ALL=C grep -q Link detected: no  return 0 || 
return 2
+   echo $output | grep -q Link detected: yes  return 1
+   echo $output | grep -q Link detected: no  return 0 || return 2
 }
 
 check_iwconfig ()
 {
[ -x /sbin/iwconfig ] || return 2
output=$(LC_ALL=C iwconfig $1 21)
-   echo $output | LC_ALL=C grep -q radio off  return 0 || return 2
+   echo $output | grep -q radio off  return 0 || return 2
 }
 
 check_link_down ()
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/functions.network

2007-10-28 Thread glen
Author: glen
Date: Sun Oct 28 17:40:52 2007
New Revision: 8885

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/functions.network
Log:
- optimize wireless_param() by calling eval once

Modified: rc-scripts/trunk/sysconfig/network-scripts/functions.network
==
--- rc-scripts/trunk/sysconfig/network-scripts/functions.network
(original)
+++ rc-scripts/trunk/sysconfig/network-scripts/functions.networkSun Oct 
28 17:40:52 2007
@@ -474,7 +474,7 @@
return 1
 }
 
-wireless_param ()
+wireless_param()
 {
device=$1
if [ $2 = br ]; then
@@ -483,53 +483,63 @@
prefix=
fi
 
-   if [ -z $(eval echo \$${prefix}WLAN_NICKNAME) ]; then
+   local val wlan_mode
+
+   if val=$(eval echo \$${prefix}WLAN_NICKNAME)  [ -z $val ]; then
 WLAN_NICKNAME=$(hostname -f 2/dev/null || hostname 
2/dev/null || echo localhost)
else
-WLAN_NICKNAME=$(eval echo \$${prefix}WLAN_NICKNAME)
+WLAN_NICKNAME=$val
fi
 
# wlan mode needs to be first
-   [ -n $(eval echo \$${prefix}WLAN_MODE) ]  \
-   iwconfig ${device} mode $(eval echo \$${prefix}WLAN_MODE)
+   wlan_mode=$(eval echo \$${prefix}WLAN_MODE)  [ -n $wlan_mode ]  
\
+   iwconfig ${device} mode $wlan_mode
+
iwconfig ${device} nick ${WLAN_NICKNAME}
-   [ -n $(eval echo \$${prefix}WLAN_NWID) ]  \
-   iwconfig ${device} nwid $(eval echo \$${prefix}WLAN_NWID)
-   if [ -n $(eval echo \$${prefix}WLAN_FREQ) -a $(eval echo 
\$${prefix}${WLAN_MODE}) != Managed ] ; then
-   iwconfig ${device} freq $(eval echo \$${prefix}WLAN_FREQ)
-   elif [ -n $(eval echo \$${prefix}WLAN_CHANNEL) -a $(eval echo 
\$${prefix}${WLAN_MODE}) != Managed ]; then
-   iwconfig ${device} channel $(eval echo 
\$${prefix}WLAN_CHANNEL)
-   fi
-   [ -n $(eval echo \$${prefix}WLAN_SENS) ]  \
-   iwconfig ${device} sens $(eval echo \$${prefix}WLAN_SENS)
-   [ -n $(eval echo \$${prefix}WLAN_AP) ]  \
-   iwconfig ${device} ap $(eval echo \$${prefix}WLAN_AP)
-   [ -n $(eval echo \$${prefix}WLAN_BITRATE) ]  \
-   iwconfig ${device} rate $(eval echo \$${prefix}WLAN_BITRATE)
-   [ -n $(eval echo \$${prefix}WLAN_RTS_THRESHOLD) ]  \
-   iwconfig ${device} rts $(eval echo 
\$${prefix}WLAN_RTS_THRESHOLD)
-   [ -n $(eval echo \$${prefix}WLAN_FRAGMENTATION_THRESHOLD) ]  \
-   iwconfig ${device} frag $(eval echo 
\$${prefix}WLAN_FRAGMENTATION_THRESHOLD)
-   if [ -n $(eval echo \$${prefix}WLAN_KEY) ]; then
-   iwconfig ${device} key $(eval echo \$${prefix}WLAN_KEY)
-   [ -n $(eval echo \$${prefix}WLAN_ENCRYPTION) ]  \
-   iwconfig ${device} key $(eval echo 
\$${prefix}WLAN_ENCRYPTION)
+
+   val=$(eval echo \$${prefix}WLAN_NWID)  [ -n $val ]  \
+   iwconfig ${device} nwid $val
+
+   if [ $wlan_mode != Managed ]; then
+   if val=$(eval echo \$${prefix}WLAN_FREQ)  [ -n $val ]; 
then
+   iwconfig ${device} freq $val
+   elif val=$(eval echo \$${prefix}WLAN_CHANNEL)  [ -n $val 
]; then
+   iwconfig ${device} channel $val
+   fi
+   fi
+
+   val=$(eval echo \$${prefix}WLAN_SENS)  [ -n $val ]  \
+   iwconfig ${device} sens $val
+   val=$(eval echo \$${prefix}WLAN_AP)  [ -n $val ]  \
+   iwconfig ${device} ap $val
+   val=$(eval echo \$${prefix}WLAN_BITRATE)  [ -n $val ]  \
+   iwconfig ${device} rate $val
+   val=$(eval echo \$${prefix}WLAN_RTS_THRESHOLD)  [ -n $val ]  \
+   iwconfig ${device} rts $val
+   val=$(eval echo \$${prefix}WLAN_FRAGMENTATION_THRESHOLD)  [ -n 
$val ]  \
+   iwconfig ${device} frag $val
+
+   if val=$(eval echo \$${prefix}WLAN_KEY)  [ -n $val ]; then
+   iwconfig ${device} key $val
+   val=$(eval echo \$${prefix}WLAN_ENCRYPTION)  [ -n $val ] 
 \
+   iwconfig ${device} key $val
fi
+
if is_no $(eval echo \$${prefix}WLAN_ENCRYPTION); then
iwconfig ${device} key off
fi
-   [ -n $(eval echo \$${prefix}WLAN_POWER) ]  \
-   iwconfig ${device} power $(eval echo \$${prefix}WLAN_POWER)
-   [ -n $(eval echo \$${prefix}WLAN_TXPOWER) ]  \
-   iwconfig ${device} txpower $(eval echo 
\$${prefix}WLAN_TXPOWER)
-   [ -n $(eval echo \$${prefix}WLAN_RETRY) ]  \
-   iwconfig ${device} retry $(eval echo \$${prefix}WLAN_RETRY)
-   [ -n $(eval echo \$${prefix}WLAN_NWID) ]  iwconfig ${device} \
-   nwid $(eval echo \$${prefix}WLAN_NWID)
+   val=$(eval echo \$${prefix}WLAN_POWER)  [ -n $val ]  \
+   iwconfig ${device} power $val
+   val=$(eval echo 

SVN: rc-scripts/trunk/sysconfig/network-scripts/functions.network

2007-10-28 Thread glen
Author: glen
Date: Sun Oct 28 17:43:27 2007
New Revision: 8886

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/functions.network
Log:
- reuse WLAN_ENCRYPTION

Modified: rc-scripts/trunk/sysconfig/network-scripts/functions.network
==
--- rc-scripts/trunk/sysconfig/network-scripts/functions.network
(original)
+++ rc-scripts/trunk/sysconfig/network-scripts/functions.networkSun Oct 
28 17:43:27 2007
@@ -519,13 +519,13 @@
val=$(eval echo \$${prefix}WLAN_FRAGMENTATION_THRESHOLD)  [ -n 
$val ]  \
iwconfig ${device} frag $val
 
+   local wlan_encryption=$(eval echo \$${prefix}WLAN_ENCRYPTION)
if val=$(eval echo \$${prefix}WLAN_KEY)  [ -n $val ]; then
iwconfig ${device} key $val
-   val=$(eval echo \$${prefix}WLAN_ENCRYPTION)  [ -n $val ] 
 \
-   iwconfig ${device} key $val
+   [ -n $wlan_encryption ]  iwconfig ${device} key 
$wlan_encryption
fi
 
-   if is_no $(eval echo \$${prefix}WLAN_ENCRYPTION); then
+   if is_no $wlan_encryption; then
iwconfig ${device} key off
fi
val=$(eval echo \$${prefix}WLAN_POWER)  [ -n $val ]  \
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/functions.network

2007-10-28 Thread glen
Author: glen
Date: Sun Oct 28 17:57:14 2007
New Revision: 

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/functions.network
Log:
- handle wlan different four keys

Modified: rc-scripts/trunk/sysconfig/network-scripts/functions.network
==
--- rc-scripts/trunk/sysconfig/network-scripts/functions.network
(original)
+++ rc-scripts/trunk/sysconfig/network-scripts/functions.networkSun Oct 
28 17:57:14 2007
@@ -520,8 +520,23 @@
iwconfig ${device} frag $val
 
local wlan_encryption=$(eval echo \$${prefix}WLAN_ENCRYPTION)
-   if val=$(eval echo \$${prefix}WLAN_KEY)  [ -n $val ]; then
-   iwconfig ${device} key $val
+   local wlan_key=$(eval echo \$${prefix}WLAN_KEY)
+   # TODO: well, actually shouldn't set WLAN_KEY if other keys than 
current are set
+   if [ -n $wlan_key ]; then
+   # wlan key can contain index of key to set
+   # to set other than current keys suffix with 1-4:
+   local idx
+   for idx in 1 2 3 4; do
+   val=$(eval echo \$${prefix}WLAN_KEY_$idx)
+   [ $val ] || continue
+   iwconfig ${device} key [$idx] $val
+   done
+   if val=$(eval echo \$${prefix}WLAN_KEY_CURRENT)  [ $val 
]; then
+   iwconfig ${device} key [$val]
+   else
+   iwconfig ${device} key $wlan_key
+   fi
+
[ -n $wlan_encryption ]  iwconfig ${device} key 
$wlan_encryption
fi
 
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/functions.network

2007-10-28 Thread glen
Author: glen
Date: Sun Oct 28 17:59:49 2007
New Revision: 8889

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/functions.network
Log:
- [ -n  ] and [  ] are the same, save some bytes/readability ;)

Modified: rc-scripts/trunk/sysconfig/network-scripts/functions.network
==
--- rc-scripts/trunk/sysconfig/network-scripts/functions.network
(original)
+++ rc-scripts/trunk/sysconfig/network-scripts/functions.networkSun Oct 
28 17:59:49 2007
@@ -27,12 +27,12 @@
# and forgot to alter DEVICE= line you won't accidentally bring down 
eth0
# while executing ifdown eth1. We do that only if configuration file 
exists
# (sometimes ifcfg-xyz isn't needed at all like server-side pppoe pppX 
interfaces)
-   if [ $foundconfig -eq 1 -a -n $DEVICE -a  $DEVNAME != $DEVICE 
]; then
+   if [ $foundconfig -eq 1 -a $DEVICE -a  $DEVNAME != $DEVICE ]; 
then
echo 2 $0: DEVICE specified in $CONFIG does not match 
filename. Aborting!
exit 1
fi
 
-   if [ -n ${PREFIX} ]  [[ $IPADDR != */* ]]; then
+   if [ ${PREFIX} ]  [[ $IPADDR != */* ]]; then
IPADDR=$IPADDR/$PREFIX
fi
 }
@@ -66,12 +66,12 @@
hostname=$(echo $1 | awk ' { gsub(/\..*$/,NIL); print $0; } ')
domain=$(echo $1 | awk ' { sub(/^[^\.]*\./,NIL); print $0; } ')
 
-   if [ -n $hostname ] ; then
+   if [ $hostname ]; then
echo $hostname  /etc/HOSTNAME
hostname $hostname
fi
 
-   if [ -n $domain ] ; then
+   if [ $domain ]; then
/etc/resolv.conf.new
if ! grep -q search $domain /etc/resolv.conf ; then
echo search $domain  /etc/resolv.conf.new
@@ -214,15 +214,15 @@
eval IP4ADDROPT=\$IP_AOPTS${IP4_PRIM_IF:-}
eval IP4ROUTEOPT=\$IP_ROPTS${IP4_PRIM_IF:-}
fi
-   if [ -n ${IP6_PRIM_IF} ] ; then
+   if [ ${IP6_PRIM_IF} ] ; then
eval IP6ADDR=\$IPADDR${IP6_PRIM_IF:-}
eval IP6ADDROPT=\$IPV6_AOPTS${IP6_PRIM_IF:-}
fi
-   if [ -n ${IP4_SRC_IF} ] ; then
+   if [ ${IP4_SRC_IF} ] ; then
eval IP4SRCADDR=\$IPADDR${IP4_SRC_IF}
IP4SRCADDR=$(echo ${IP4SRCADDR} | awk ' { gsub(/\/.*/,NIL); 
print src  $0; } ')
fi
-   if [ -n ${IP6_SRC_IF} ] ; then
+   if [ ${IP6_SRC_IF} ] ; then
eval IP6SRCADDR=\$IPADDR${IP6_SRC_IF}
IP6SRCADDR=$(echo ${IP6SRCADDR} | awk ' { gsub(/\/.*/,NIL); 
print src  $0; } ')
fi
@@ -254,7 +254,7 @@
fi
 
# ARP ready devices
-   if [ -n $ARP ] ; then
+   if [ $ARP ] ; then
if is_yes $ARP; then
ARP=arp on
else
@@ -278,7 +278,7 @@
if is_yes $IPV4_NETWORKING; then
if [ -z ${GATEWAYDEV} -o ${GATEWAYDEV} = ${DEVICE} ]; then
# set up default gateway
-   if [ -n ${GATEWAY} ]; then
+   if [ ${GATEWAY} ]; then
ip -4 route add default via ${GATEWAY} dev 
${DEVICE} ${IP4SRCADDR} onlink 2/dev/null
if [ $? = 0 ]; then
DEFGW=${GATEWAY}
@@ -297,7 +297,7 @@
if is_yes $IPV6_NETWORKING; then
if [ -z ${GATEWAY6DEV} -o ${GATEWAY6DEV} = ${DEVICE} ]; 
then
# set up default gateway
-   if [ -n ${GATEWAY6} ]; then
+   if [ ${GATEWAY6} ]; then
ip -6 route add default via ${GATEWAY6} dev 
${DEVICE} ${IP6SRCADDR} onlink
DEFGW6=${GATEWAY6}
elif [ ${GATEWAY6DEV} = ${DEVICE} ]; then
@@ -306,7 +306,7 @@
fi
if [ -z ${IPV6_GLOBALROUTEDEV} -o ${IPV6_GLOBALROUTEDEV} = 
${DEVICE} ]; then
# set up default route
-   if [ -n ${IPV6_GLOBALROUTEGW} ]; then
+   if [ ${IPV6_GLOBALROUTEGW} ]; then
ip -6 route add 2000::/3 via 
${IPV6_GLOBALROUTEGW} dev ${DEVICE} ${IP6SRCADDR} onlink
elif [ ${IPV6_GLOBALROUTEDEV} = ${DEVICE} ]; then
ip -6 route add 2000::/3 dev ${DEVICE} 
${IP6SRCADDR}
@@ -399,7 +399,7 @@
typeset prefix a MASK
 
MASK=
-   if [ -n ${1##[0-9]*} ]; then
+   if [ ${1##[0-9]*} ]; then
prefix=32
else
typeset -i prefix=$1
@@ -492,37 +492,37 @@
fi
 
# wlan mode needs to be first
-   wlan_mode=$(eval echo \$${prefix}WLAN_MODE)  [ -n $wlan_mode ]  
\
+   wlan_mode=$(eval echo \$${prefix}WLAN_MODE)  [ $wlan_mode ]  \
iwconfig ${device} mode $wlan_mode
 
iwconfig ${device} nick 

SVN: rc-scripts/trunk/sysconfig/network-scripts/functions.network

2007-10-28 Thread glen
Author: glen
Date: Sun Oct 28 18:56:41 2007
New Revision: 8891

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/functions.network
Log:
- key index and value should be different arguments

Modified: rc-scripts/trunk/sysconfig/network-scripts/functions.network
==
--- rc-scripts/trunk/sysconfig/network-scripts/functions.network
(original)
+++ rc-scripts/trunk/sysconfig/network-scripts/functions.networkSun Oct 
28 18:56:41 2007
@@ -529,7 +529,7 @@
for idx in 1 2 3 4; do
val=$(eval echo \$${prefix}WLAN_KEY_$idx)
[ $val ] || continue
-   iwconfig ${device} key [$idx] $val
+   iwconfig ${device} key [$idx] $val
done
if val=$(eval echo \$${prefix}WLAN_KEY_CURRENT)  [ $val 
]; then
iwconfig ${device} key [$val]
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/functions.network

2007-10-28 Thread glen
Author: glen
Date: Sun Oct 28 18:57:14 2007
New Revision: 8892

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/functions.network
Log:
- allow WLAN_MODE=managed in lowercase (as it's in doc)

Modified: rc-scripts/trunk/sysconfig/network-scripts/functions.network
==
--- rc-scripts/trunk/sysconfig/network-scripts/functions.network
(original)
+++ rc-scripts/trunk/sysconfig/network-scripts/functions.networkSun Oct 
28 18:57:14 2007
@@ -500,7 +500,7 @@
val=$(eval echo \$${prefix}WLAN_NWID)  [ $val ]  \
iwconfig ${device} nwid $val
 
-   if [ $wlan_mode != Managed ]; then
+   if [ $wlan_mode != Managed -a $wlan_mode != managed ]; then
if val=$(eval echo \$${prefix}WLAN_FREQ)  [ $val ]; then
iwconfig ${device} freq $val
elif val=$(eval echo \$${prefix}WLAN_CHANNEL)  [ $val ]; 
then
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/ifup

2007-10-03 Thread glen
Author: glen
Date: Wed Oct  3 08:55:52 2007
New Revision: 8770

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/ifup
Log:
- trim network length from $IP4ADDR when doing arping

Modified: rc-scripts/trunk/sysconfig/network-scripts/ifup
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifup (original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifup Wed Oct  3 08:55:52 2007
@@ -185,9 +185,9 @@
fi
 
if is_yes $IPV4_NETWORKING  [ -n ${IP4ADDR} -a -x /sbin/arping ]; 
then
-   # update ARP cache of neighboring computers
-   /sbin/arping -q -A -c 1 -I ${DEVICE} ${IP4ADDR}
-   ( sleep 2; /sbin/arping -q -U -c 1 -I ${DEVICE} ${IP4ADDR} )  
/dev/null 21  /dev/null 
+   # update ARP cache of neighbouring computers
+   /sbin/arping -q -A -c 1 -I ${DEVICE} ${IP4ADDR%/*}
+   ( sleep 2; /sbin/arping -q -U -c 1 -I ${DEVICE} ${IP4ADDR%/*} ) 
 /dev/null 21  /dev/null 
fi
 
# IPv4/6 gateways and default routes
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/functions.network

2007-10-03 Thread arekm
Author: arekm
Date: Wed Oct  3 15:10:23 2007
New Revision: 8771

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/functions.network
Log:
Do sanity check only when configuration file exists.

Modified: rc-scripts/trunk/sysconfig/network-scripts/functions.network
==
--- rc-scripts/trunk/sysconfig/network-scripts/functions.network
(original)
+++ rc-scripts/trunk/sysconfig/network-scripts/functions.networkWed Oct 
 3 15:10:23 2007
@@ -7,6 +7,8 @@
 
 source_config ()
 {
+   typeset foundconfig=0
+
DEVNAME=${CONFIG##*/}
DEVNAME=${DEVNAME##ifcfg-}
DEVNAME=${DEVNAME##tnlcfg-}
@@ -14,15 +16,18 @@
if [[ $CONFIG = /* ]]; then
if [ -f $CONFIG ] ; then
. $CONFIG
+   foundconfig=1
fi
elif [ -f /etc/sysconfig/interfaces/$CONFIG ] ; then
. /etc/sysconfig/interfaces/$CONFIG
+   foundconfig=1
fi
 
# This is sanity check so that if you've copied ifcfg-eth0 to ifcfg-eth1
# and forgot to alter DEVICE= line you won't accidentally bring down 
eth0
-   # while executing ifdown eth1.
-   if [ -n $DEVICE -a  $DEVNAME != $DEVICE ]; then
+   # while executing ifdown eth1. We do that only if configuration file 
exists
+   # (sometimes ifcfg-xyz isn't needed at all like server-side pppoe pppX 
interfaces)
+   if [ $foundconfig -eq 1 -a -n $DEVICE -a  $DEVNAME != $DEVICE 
]; then
echo 2 $0: DEVICE specified in $CONFIG does not match 
filename. Aborting!
exit 1
fi
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/functions.network

2007-10-01 Thread glen
Author: glen
Date: Mon Oct  1 10:45:51 2007
New Revision: 8768

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/functions.network
Log:
- support $IPADDR + $NETMASK combination if no prefix in $IPADDR present

Modified: rc-scripts/trunk/sysconfig/network-scripts/functions.network
==
--- rc-scripts/trunk/sysconfig/network-scripts/functions.network
(original)
+++ rc-scripts/trunk/sysconfig/network-scripts/functions.networkMon Oct 
 1 10:45:51 2007
@@ -196,7 +196,13 @@
DEVICE=$(echo $DEVICE | awk ' { gsub(/:.*$/,NUL); print $0 } ')
 
eval IP4ADDR=\$IPADDR${IP4_PRIM_IF:-}
-   if echo ${IP4ADDR} | grep -q : ; then
+   # check if ipaddr doesn't contain network length -- use $NETMASK then
+   if [[ $IP4ADDR != */* ]]  [ $NETMASK ]; then
+   IP4ADDR=$IP4ADDR/$(calcprefix $NETMASK)
+   fi
+
+   # check if we have ipv6 or ipv4 address
+   if [[ ${IP4ADDR} = *:* ]]; then
IP6ADDR=${IP4ADDR}
IP4ADDR=
else
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/ifup

2007-09-26 Thread glen
Author: glen
Date: Wed Sep 26 14:17:32 2007
New Revision: 8753

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/ifup
Log:
- typo in arping line

Modified: rc-scripts/trunk/sysconfig/network-scripts/ifup
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifup (original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifup Wed Sep 26 14:17:32 2007
@@ -184,7 +184,7 @@
ip addr add ${IP6ADDR} dev ${DEVICE} ${IP6ADDROPT}
fi
 
-   if is_yes $IPV4_NETWORKING  [ -n ${IP4ADDR} -a -x /sbin/arping]; 
then
+   if is_yes $IPV4_NETWORKING  [ -n ${IP4ADDR} -a -x /sbin/arping ]; 
then
# update ARP cache of neighboring computers
/sbin/arping -q -A -c 1 -I ${DEVICE} ${IP4ADDR}
( sleep 2; /sbin/arping -q -U -c 1 -I ${DEVICE} ${IP4ADDR} )  
/dev/null 21  /dev/null 
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network

2007-09-25 Thread glen
Author: glen
Date: Tue Sep 25 13:32:53 2007
New Revision: 8745

Modified:
   rc-scripts/trunk/sysconfig/network
Log:
- more info about AUTOMATIC_IFCFG

Modified: rc-scripts/trunk/sysconfig/network
==
--- rc-scripts/trunk/sysconfig/network  (original)
+++ rc-scripts/trunk/sysconfig/network  Tue Sep 25 13:32:53 2007
@@ -15,6 +15,7 @@
 HOSTNAME=pldmachine
 
 # Allow udev to create /etc/sysconfig/interfaces/ifcfg-* automatically?
+# See /lib/udev/udev_net_helper for details.
 AUTOMATIC_IFCFG=no
 
 # Set NIS domain name here if you use NIS
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/ifup

2007-09-11 Thread arekm
Author: arekm
Date: Tue Sep 11 20:33:38 2007
New Revision: 8719

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/ifup
Log:
Update ARP cache of neighbours (from fedora).

Modified: rc-scripts/trunk/sysconfig/network-scripts/ifup
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifup (original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifup Tue Sep 11 20:33:38 2007
@@ -184,6 +184,12 @@
ip addr add ${IP6ADDR} dev ${DEVICE} ${IP6ADDROPT}
fi
 
+   if [ -x /sbin/arping ]; then
+   # update ARP cache of neighboring computers
+   /sbin/arping -q -A -c 1 -I ${REALDEVICE} ${IPADDR}
+   ( sleep 2; /sbin/arping -q -U -c 1 -I ${REALDEVICE} ${IPADDR} ) 
 /dev/null 21  /dev/null 
+   fi
+
# IPv4/6 gateways and default routes
setup_ip_gw_ro
 fi
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/ifup

2007-09-11 Thread arekm
Author: arekm
Date: Tue Sep 11 20:47:57 2007
New Revision: 8720

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/ifup
Log:
PLDize ARP cache updating procedure.

Modified: rc-scripts/trunk/sysconfig/network-scripts/ifup
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifup (original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifup Tue Sep 11 20:47:57 2007
@@ -184,10 +184,10 @@
ip addr add ${IP6ADDR} dev ${DEVICE} ${IP6ADDROPT}
fi
 
-   if [ -x /sbin/arping ]; then
+   if is_yes $IPV4_NETWORKING  [ -n ${IP4ADDR} -a -x /sbin/arping]; 
then
# update ARP cache of neighboring computers
-   /sbin/arping -q -A -c 1 -I ${REALDEVICE} ${IPADDR}
-   ( sleep 2; /sbin/arping -q -U -c 1 -I ${REALDEVICE} ${IPADDR} ) 
 /dev/null 21  /dev/null 
+   /sbin/arping -q -A -c 1 -I ${DEVICE} ${IP4ADDR}
+   ( sleep 2; /sbin/arping -q -U -c 1 -I ${DEVICE} ${IP4ADDR} )  
/dev/null 21  /dev/null 
fi
 
# IPv4/6 gateways and default routes
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network

2007-07-14 Thread radek
Author: radek
Date: Sat Jul 14 22:33:12 2007
New Revision: 8676

Modified:
   rc-scripts/trunk/sysconfig/network
Log:
- AUTOMATIC_IFCFG=no

Modified: rc-scripts/trunk/sysconfig/network
==
--- rc-scripts/trunk/sysconfig/network  (original)
+++ rc-scripts/trunk/sysconfig/network  Sat Jul 14 22:33:12 2007
@@ -14,6 +14,9 @@
 # Set hostname here (only hostname)
 HOSTNAME=pldmachine
 
+# Allow udev to create /etc/sysconfig/interfaces/ifcfg-* automatically?
+AUTOMATIC_IFCFG=no
+
 # Set NIS domain name here if you use NIS
 # Note: DNS domain name should be set in /etc/hosts or DNS/NIS service, not 
here
 NISDOMAIN=
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/ifdown-ppp

2007-04-28 Thread qboosh
Author: qboosh
Date: Sat Apr 28 20:34:56 2007
New Revision: 8485

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/ifdown-ppp
Log:
- kill ugly warning if pppd was nicely killed

Modified: rc-scripts/trunk/sysconfig/network-scripts/ifdown-ppp
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifdown-ppp   (original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifdown-ppp   Sat Apr 28 
20:34:56 2007
@@ -33,8 +33,10 @@
 sleep 2
 [ -d /proc/${PID} ]  sleep 2  [ -d /proc/${PID} ]  sleep 5
 
-kill -KILL ${PID}  /dev/null 21
-logger -p daemon.info -t ifdown-ppp ifdown-ppp unable to nicely kill 
pppd-$DEVICE (pppd-$DEVNAME) 
+if [ -d /proc/${PID} ]; then
+   kill -KILL ${PID}  /dev/null 21
+   logger -p daemon.info -t ifdown-ppp ifdown-ppp unable to nicely kill 
pppd-$DEVICE (pppd-$DEVNAME) 
+fi
 
 # Special cases
 if is_yes ${PPPOA_EAGLE}; then
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/functions.network

2007-04-16 Thread baggins
Author: baggins
Date: Mon Apr 16 18:21:27 2007
New Revision: 8459

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/functions.network
Log:
- calcprefix without need of awk


Modified: rc-scripts/trunk/sysconfig/network-scripts/functions.network
==
--- rc-scripts/trunk/sysconfig/network-scripts/functions.network
(original)
+++ rc-scripts/trunk/sysconfig/network-scripts/functions.networkMon Apr 
16 18:21:27 2007
@@ -352,43 +352,33 @@
fi
 }
 
-#
-# folowing function calculates network prefix from given network mask
-# (c) 1999 Grzegorz Stanislawski [EMAIL PROTECTED]
-#
+# calculate network prefix from given network mask
 calcprefix()
 {
-   typeset len olen bad prefix
+   typeset old_IFS netmask prefix endp
+
+   old_IFS=$IFS
+   IFS='.'
+   netmask=$(echo $1)
+   IFS=$old_IFS
 
prefix=0
-   olen=8
-   bad=0
-   for i in 1 2 3 4; do
-   len=0
-   j=$(echo $1 | awk -F. { print \$${i} })
-   case $j in
- 255)  len=8 ;;
- 254)  len=7 ;;
- 252)  len=6 ;;
- 248)  len=5 ;;
- 240)  len=4 ;;
- 224)  len=3 ;;
- 192)  len=2 ;;
- 128)  len=1 ;;
- 0)len=0 ;;
- *)len=300 ;;
-   esac
-   [ $len -gt $olen ]  bad=1
-   prefix=$(($prefix + $len))
-   olen=$len
+   endp=0
+   for n in $netmask ; do
+   for i in 128 64 32 16 8 4 2 1 ; do
+   if [ $(($n  $i)) -ne 0 ]; then
+   if [ $endp -eq 0 ]; then
+   prefix=$(($prefix + 1))
+   else
+   echo 32
+   return
+   fi
+   else
+   endp=1
+   fi
+   done
done
-
-   if [ $bad = 0 ]; then
-   echo $prefix
-   else
-   echo 32
-   fi
-   return
+   echo $prefix
 }
 
 #
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/functions.network

2007-04-16 Thread baggins
Author: baggins
Date: Mon Apr 16 19:26:54 2007
New Revision: 8460

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/functions.network
Log:
- use shell construct instead of grep in calcnetmask


Modified: rc-scripts/trunk/sysconfig/network-scripts/functions.network
==
--- rc-scripts/trunk/sysconfig/network-scripts/functions.network
(original)
+++ rc-scripts/trunk/sysconfig/network-scripts/functions.networkMon Apr 
16 19:26:54 2007
@@ -381,16 +381,14 @@
echo $prefix
 }
 
-#
-# folowing function calculates network mask from given prefix
+# calculate network mask from given prefix
 # (c) 1999 Grzegorz Stanislawski [EMAIL PROTECTED]
-#
 calcnetmask()
 {
typeset prefix a MASK
 
MASK=
-   if [ `echo ${1} | grep ^[0-9]` =  ]; then
+   if [ -n ${1##[0-9]*} ]; then
prefix=32
else
typeset -i prefix=$1
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/functions.network

2007-02-08 Thread glen
Author: glen
Date: Thu Feb  8 16:42:13 2007
New Revision: 8239

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/functions.network
Log:
- allow tnlcfg- prefix in interface CONFIGs

Modified: rc-scripts/trunk/sysconfig/network-scripts/functions.network
==
--- rc-scripts/trunk/sysconfig/network-scripts/functions.network
(original)
+++ rc-scripts/trunk/sysconfig/network-scripts/functions.networkThu Feb 
 8 16:42:13 2007
@@ -7,7 +7,9 @@
 
 source_config ()
 {
-   DEVNAME=${CONFIG##*/ifcfg-}
+   DEVNAME=${CONFIG##*/}
+   DEVNAME=${DEVNAME##ifcfg-}
+   DEVNAME=${DEVNAME##tnlcfg-}
 
if [[ $CONFIG = /* ]]; then
if [ -f $CONFIG ] ; then
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/functions.network

2007-01-22 Thread glen
Author: glen
Date: Mon Jan 22 19:09:46 2007
New Revision: 8185

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/functions.network
Log:
Less subshells in source_config().

Modified: rc-scripts/trunk/sysconfig/network-scripts/functions.network
==
--- rc-scripts/trunk/sysconfig/network-scripts/functions.network
(original)
+++ rc-scripts/trunk/sysconfig/network-scripts/functions.networkMon Jan 
22 19:09:46 2007
@@ -7,9 +7,9 @@
 
 source_config ()
 {
-   DEVNAME=$(basename $CONFIG | awk ' { gsub(/^ifcfg-/,NIL); print $0; } 
')
+   DEVNAME=${CONFIG##*/ifcfg-}
 
-   if echo $CONFIG|egrep ^/ /dev/null 21 ; then
+   if [[ $CONFIG = /* ]]; then
if [ -f $CONFIG ] ; then
. $CONFIG
fi
@@ -25,7 +25,7 @@
exit 1
fi
 
-   if [ -n ${PREFIX} ]  ! $(echo $IPADDR | grep / 21 /dev/null) ; 
then
+   if [ -n ${PREFIX} ]  [[ $IPADDR != */* ]]; then
IPADDR=$IPADDR/$PREFIX
fi
 }
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/functions.network

2007-01-22 Thread glen
Author: glen
Date: Mon Jan 22 19:16:11 2007
New Revision: 8186

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/functions.network
Log:
Cache hostname output to call it less times

Modified: rc-scripts/trunk/sysconfig/network-scripts/functions.network
==
--- rc-scripts/trunk/sysconfig/network-scripts/functions.network
(original)
+++ rc-scripts/trunk/sysconfig/network-scripts/functions.networkMon Jan 
22 19:16:11 2007
@@ -43,8 +43,9 @@
 
 need_hostname()
 {
-   if [ `hostname` = (none) -o `hostname` = localhost -o \
-`hostname` = localhost.localdomain ]; then
+   local hostname=$(hostname)
+   if [ $hostname = (none) -o $hostname = localhost -o \
+$hostname = localhost.localdomain ]; then
NEEDHOSTNAME=yes
else
unset NEEDHOSTNAME
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/ifup-aliases

2007-01-22 Thread glen
Author: glen
Date: Mon Jan 22 19:37:58 2007
New Revision: 8187

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/ifup-aliases
Log:
Die debug

Modified: rc-scripts/trunk/sysconfig/network-scripts/ifup-aliases
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifup-aliases (original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifup-aliases Mon Jan 22 
19:37:58 2007
@@ -74,7 +74,6 @@
 done
 
 for nr in $(awk 'BEGIN { max=0; }; /^IPADDR[0-9]+=/ { s = $0; gsub(/^IPADDR/, 
, s); gsub(/=.*/, , s); if (int(s)  int(max)) { max=s; }; };  END { 
for(j=1; j=int(max); j++) print j } ' $CONFIG); do
-   echo $nr
eval IP_ADDR=\$IPADDR${nr}
[ -z $IP_ADDR ]  continue
 
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts: ifup-aliases ifup-neigh ifup-post ifup-routes

2007-01-22 Thread glen
Author: glen
Date: Mon Jan 22 19:41:56 2007
New Revision: 8188

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/ifup-aliases
   rc-scripts/trunk/sysconfig/network-scripts/ifup-neigh
   rc-scripts/trunk/sysconfig/network-scripts/ifup-post
   rc-scripts/trunk/sysconfig/network-scripts/ifup-routes
Log:
ifup-{aliases,routes,neigh} are now sourced instead of executed

Modified: rc-scripts/trunk/sysconfig/network-scripts/ifup-aliases
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifup-aliases (original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifup-aliases Mon Jan 22 
19:41:56 2007
@@ -4,29 +4,6 @@
 #
 # adds all addresses of device $1
 
-. /etc/sysconfig/network
-. /etc/rc.d/init.d/functions
-. /etc/sysconfig/network-scripts/functions.network
-
-# device name must be ifcfg-somename
-DEV=$1
-
-[ -z $DEV ]  {
-   nls Usage: %s device name ifup-aliases 2
-   exit 1
-}
-
-if [ -f /etc/sysconfig/interfaces/ifcfg-$DEV ] ; then
-   CONFIG=/etc/sysconfig/interfaces/ifcfg-$DEV
-else
-   CONFIG=$DEV
-fi
-
-source_config
-
-# set all major variables
-setup_ip_param
-
 # Add all addresses
 for IP_ADDR in $IPADDR_ALIASES; do
IP_ADDR_OPT=

Modified: rc-scripts/trunk/sysconfig/network-scripts/ifup-neigh
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifup-neigh   (original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifup-neigh   Mon Jan 22 
19:41:56 2007
@@ -4,34 +4,10 @@
 #
 # adds static arps for device $DEVICE
 
-. /etc/sysconfig/network
-. /etc/rc.d/init.d/functions
-. /etc/sysconfig/network-scripts/functions.network
-
-DEV=$1
-
-if [ -z $DEV ]; then
-   nls Usage: %s device name ifup-neigh 2
-   exit 1
-fi
-
 if [ ! -f /etc/sysconfig/static-arp ]; then
-   exit 0
+   return
 fi
 
-if [ -f /etc/sysconfig/interfaces/ifcfg-$DEV ] ; then
-   CONFIG=/etc/sysconfig/interfaces/ifcfg-$DEV
-else
-   CONFIG=$DEV
-fi
-
-source_config
-
-# set all major variables
-setup_ip_param
-
-get_ppp_device_and_pid
-
 # note the trailing white space character in the grep gets rid of aliases
 egrep ^($DEVICE|any)[[:blank:]] /etc/sysconfig/static-arp | while read iface 
mac ip state args; do
if is_no $IPV4_NETWORKING; then

Modified: rc-scripts/trunk/sysconfig/network-scripts/ifup-post
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifup-post(original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifup-postMon Jan 22 
19:41:56 2007
@@ -52,9 +52,9 @@
tc filter add dev ${REALDEVICE} parent : protocol ip prio 50 u32 
match ip src 0.0.0.0/0 police rate ${BANDWIDTH_IN}kbit burst 10k drop flowid :3
 fi
 
-/etc/sysconfig/network-scripts/ifup-aliases ${CONFIG}
-/etc/sysconfig/network-scripts/ifup-routes ${CONFIG}
-/etc/sysconfig/network-scripts/ifup-neigh ${CONFIG}
+. /etc/sysconfig/network-scripts/ifup-aliases
+. /etc/sysconfig/network-scripts/ifup-routes
+. /etc/sysconfig/network-scripts/ifup-neigh
 
 # don't set hostname on ppp/slip connections
 if [ -n $NEEDHOSTNAME -a ${DEVICETYPE} != ppp -a ${DEVICETYPE} != 
slip ]; then

Modified: rc-scripts/trunk/sysconfig/network-scripts/ifup-routes
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifup-routes  (original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifup-routes  Mon Jan 22 
19:41:56 2007
@@ -4,34 +4,10 @@
 #
 # adds static routes which go through device $DEVICE
 
-. /etc/sysconfig/network
-. /etc/rc.d/init.d/functions
-. /etc/sysconfig/network-scripts/functions.network
-
-DEV=$1
-
-if [ -z $DEV ]; then
-   nls Usage: %s device name ifup-routes 2
-   exit 1
-fi
-
 if [ ! -f /etc/sysconfig/static-routes ]; then
-   exit 0
+   return
 fi
 
-if [ -f /etc/sysconfig/interfaces/ifcfg-$DEV ] ; then
-   CONFIG=/etc/sysconfig/interfaces/ifcfg-$DEV
-else
-   CONFIG=$DEV
-fi
-
-source_config
-
-# set all major variables
-setup_ip_param
-
-get_ppp_device_and_pid
-
 # note the trailing white space character in the grep gets rid of aliases
 egrep ^($DEVICE|any)[[:blank:]] /etc/sysconfig/static-routes | while read 
device args; do
if (echo $args | grep -q :) then
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts: ifup-aliases ifup-neigh ifup-routes

2007-01-22 Thread glen
Author: glen
Date: Mon Jan 22 19:45:10 2007
New Revision: 8189

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/ifup-aliases   (contents, props 
changed)
   rc-scripts/trunk/sysconfig/network-scripts/ifup-neigh   (contents, props 
changed)
   rc-scripts/trunk/sysconfig/network-scripts/ifup-routes   (contents, props 
changed)
Log:
- updated comments

Modified: rc-scripts/trunk/sysconfig/network-scripts/ifup-aliases
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifup-aliases (original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifup-aliases Mon Jan 22 
19:45:10 2007
@@ -2,7 +2,8 @@
 #
 #  $Id$
 #
-# adds all addresses of device $1
+# Adds all addresses of device.
+# Called from ifup-post.
 
 # Add all addresses
 for IP_ADDR in $IPADDR_ALIASES; do

Modified: rc-scripts/trunk/sysconfig/network-scripts/ifup-neigh
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifup-neigh   (original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifup-neigh   Mon Jan 22 
19:45:10 2007
@@ -2,7 +2,8 @@
 #
 #  $Id$
 #
-# adds static arps for device $DEVICE
+# Adds static arps for device $DEVICE
+# Called from ifup-post.
 
 if [ ! -f /etc/sysconfig/static-arp ]; then
return

Modified: rc-scripts/trunk/sysconfig/network-scripts/ifup-routes
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifup-routes  (original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifup-routes  Mon Jan 22 
19:45:10 2007
@@ -2,7 +2,8 @@
 #
 #  $Id$
 #
-# adds static routes which go through device $DEVICE
+# Adds static routes which go through device $DEVICE
+# Called from ifup-post.
 
 if [ ! -f /etc/sysconfig/static-routes ]; then
return
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/ifup-neigh

2007-01-22 Thread glen
Author: glen
Date: Mon Jan 22 19:46:33 2007
New Revision: 8190

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/ifup-neigh
Log:
- IPV4_NETWORKING does not change it's value in a loop.

Modified: rc-scripts/trunk/sysconfig/network-scripts/ifup-neigh
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifup-neigh   (original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifup-neigh   Mon Jan 22 
19:46:33 2007
@@ -5,15 +5,16 @@
 # Adds static arps for device $DEVICE
 # Called from ifup-post.
 
+if is_no $IPV4_NETWORKING; then
+   return
+fi
+
 if [ ! -f /etc/sysconfig/static-arp ]; then
return
 fi
 
 # note the trailing white space character in the grep gets rid of aliases
 egrep ^($DEVICE|any)[[:blank:]] /etc/sysconfig/static-arp | while read iface 
mac ip state args; do
-   if is_no $IPV4_NETWORKING; then
-   continue
-   fi
[ -z $state ]  state=stale
/sbin/ip neigh replace $ip lladdr $mac nud $state dev $DEVICE
 done
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts/ifup-routes

2007-01-22 Thread glen
Author: glen
Date: Mon Jan 22 19:47:33 2007
New Revision: 8191

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/ifup-routes
Log:
- kill subshell

Modified: rc-scripts/trunk/sysconfig/network-scripts/ifup-routes
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifup-routes  (original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifup-routes  Mon Jan 22 
19:47:33 2007
@@ -11,7 +11,7 @@
 
 # note the trailing white space character in the grep gets rid of aliases
 egrep ^($DEVICE|any)[[:blank:]] /etc/sysconfig/static-routes | while read 
device args; do
-   if (echo $args | grep -q :) then
+   if [[ $args = *:* ]]; then
if is_no $IPV6_NETWORKING; then
continue
fi
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


SVN: rc-scripts/trunk/sysconfig/network-scripts: functions.network ifdown ifup

2007-01-22 Thread glen
Author: glen
Date: Mon Jan 22 20:10:05 2007
New Revision: 8192

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/functions.network
   rc-scripts/trunk/sysconfig/network-scripts/ifdown
   rc-scripts/trunk/sysconfig/network-scripts/ifup
Log:
- be sure that dhcp client detection is same for ifup and ifdown

Modified: rc-scripts/trunk/sysconfig/network-scripts/functions.network
==
--- rc-scripts/trunk/sysconfig/network-scripts/functions.network
(original)
+++ rc-scripts/trunk/sysconfig/network-scripts/functions.networkMon Jan 
22 20:10:05 2007
@@ -75,6 +75,28 @@
fi
 }
 
+set_dhcpclient()
+{
+   if [ $BOOTPROTO = bootp -o $BOOTPROTO = pump ]; then
+   DHCP_CLIENT=/sbin/pump
+   fi
+
+   if [ -z $DHCP_CLIENT ]; then
+   if [ -x /sbin/dhcpcd ]; then
+   DHCP_CLIENT=/sbin/dhcpcd
+   elif [ -x /sbin/dhclient ]; then
+   DHCP_CLIENT=/sbin/dhclient
+   elif [ -x /sbin/dhcpxd ]; then
+   DHCP_CLIENT=/sbin/dhcpxd
+   elif [ -x /sbin/pump ]; then
+   DHCP_CLIENT=/sbin/pump
+   else
+   nls Can't find a dhcp client.
+   exit 1
+   fi
+   fi
+}
+
 # Setup Network Address Translation (NAT)
 setup_nat()
 {

Modified: rc-scripts/trunk/sysconfig/network-scripts/ifdown
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifdown   (original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifdown   Mon Jan 22 20:10:05 2007
@@ -59,31 +59,36 @@
fi
 fi
 
-if [ $BOOTPROTO = bootp -o $BOOTPROTO = pump ]; then
-   /sbin/pump -r -i ${DEVICE}
-   RESULT=$?
-fi
-
-if [ $BOOTPROTO = dhcp ]; then
-   if [ -x /sbin/dhcpcd ];then
-   /sbin/dhcpcd -k ${DEVICE}
-   RESULT=$?
-   elif [ -x /sbin/dhclient ];then
-   if [ -f /var/run/dhclient.pid ];then
-   PID=$(cat /var/run/dhclient.pid)
-   if ps ax --no-header|grep -q $PID;then
-   kill $PID
-   RESULT=$?
+if [ -n $BOOTPROTO -a $BOOTPROTO != none -a $BOOTPROTO != static ]; 
then
+   if is_yes $IPV4_NETWORKING; then
+   set_dhcpclient
+
+   case ${DHCP_CLIENT##*/} in
+ pump)
+   /sbin/pump -r -i ${DEVICE}
+   RESULT=$?
+   ;;
+ dhcpcd)
+   /sbin/dhcpcd -k ${DEVICE}
+   RESULT=$?
+   ;;
+ dhcpxd)
+   /sbin/dhcpxd -k ${DEVICE}
+   RESULT=$?
+   ;;
+ dhclient)
+   if [ -f /var/run/dhclient.pid ];then
+   PID=$(cat /var/run/dhclient.pid)
+   if ps ax --no-header | grep -q $PID; then
+   kill $PID
+   RESULT=$?
+   fi
fi
-   fi
-   elif [ -x /sbin/dhcpxd ];then
-   /sbin/dhcpxd -k ${DEVICE}
-   RESULT=$?
-   elif [ -x /sbin/pump ];then
-   pump -r -i ${DEVICE}
-   RESULT=$?
+   ;;
+   esac
+
+   sleep 1 # WHY?
fi
-   sleep 1
 fi
 
 if is_wireless_device ${DEVICE}; then

Modified: rc-scripts/trunk/sysconfig/network-scripts/ifup
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifup (original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifup Mon Jan 22 20:10:05 2007
@@ -119,24 +119,7 @@
 
 if [ -n $BOOTPROTO -a $BOOTPROTO != none -a $BOOTPROTO != static ]; 
then
if is_yes $IPV4_NETWORKING; then
-   if [ $BOOTPROTO = bootp -o $BOOTPROTO = pump ]; then
-   DHCP_CLIENT=/sbin/pump
-   fi
-
-   if [ -z $DHCP_CLIENT ]; then
-   if [ -x /sbin/dhcpcd ]; then
-   DHCP_CLIENT=/sbin/dhcpcd
-   elif [ -x /sbin/dhclient ]; then
-   DHCP_CLIENT=/sbin/dhclient
-   elif [ -x /sbin/dhcpxd ]; then
-   DHCP_CLIENT=/sbin/dhcpxd
-   elif [ -x /sbin/pump ]; then
-   DHCP_CLIENT=/sbin/pump
-   else
-   nls Can't find a dhcp client.
-   exit 1
-   fi
-   fi
+   set_dhcpclient
 
DHCP_ARGS=
if [ -n $DHCP_CLIENT 

SVN: rc-scripts/trunk/sysconfig/network-scripts/ifdown

2007-01-22 Thread glen
Author: glen
Date: Mon Jan 22 20:12:26 2007
New Revision: 8193

Modified:
   rc-scripts/trunk/sysconfig/network-scripts/ifdown
Log:
- reuase $DHCP_CLIENT

Modified: rc-scripts/trunk/sysconfig/network-scripts/ifdown
==
--- rc-scripts/trunk/sysconfig/network-scripts/ifdown   (original)
+++ rc-scripts/trunk/sysconfig/network-scripts/ifdown   Mon Jan 22 20:12:26 2007
@@ -65,15 +65,15 @@
 
case ${DHCP_CLIENT##*/} in
  pump)
-   /sbin/pump -r -i ${DEVICE}
+   $DHCP_CLIENT -r -i ${DEVICE}
RESULT=$?
;;
  dhcpcd)
-   /sbin/dhcpcd -k ${DEVICE}
+   $DHCP_CLIENT -k ${DEVICE}
RESULT=$?
;;
  dhcpxd)
-   /sbin/dhcpxd -k ${DEVICE}
+   $DHCP_CLIENT -k ${DEVICE}
RESULT=$?
;;
  dhclient)
___
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit


  1   2   >