[Lunar-commits] r23820 - moonbase/branches/crater/net/net-tools
Auke Kok
sofar at lunar-linux.org
Mon Mar 26 16:56:56 CEST 2007
Author: sofar
Date: 2007-03-26 16:56:56 +0200 (Mon, 26 Mar 2007)
New Revision: 23820
Modified:
moonbase/branches/crater/net/net-tools/network
Log:
Useless ';' at end of line - makes my diff unreadable
Modified: moonbase/branches/crater/net/net-tools/network
===================================================================
--- moonbase/branches/crater/net/net-tools/network 2007-03-26 14:30:43 UTC (rev 23819)
+++ moonbase/branches/crater/net/net-tools/network 2007-03-26 14:56:56 UTC (rev 23820)
@@ -56,48 +56,48 @@
# but doesn't call the dhcp client since there's no connection yet
# Please don't fail here because ifplugd is already running
if ! ifplugd -c -i $1 &> /dev/null ; then
- $IFPLUGD -I -i $1 -f;
- fi;
+ $IFPLUGD -I -i $1 -f
+ fi
# FIXME: Make the config file configurable.
# Also, rely on the configuration to determine whether or not the interface is enabled
- $WPA_SUPPLICANT -B -w -Dwext -i${1} -c/etc/wpa_supplicant.conf;
+ $WPA_SUPPLICANT -B -w -Dwext -i${1} -c/etc/wpa_supplicant.conf
else
- echo -n " ERROR: wpa_supplicant and/or ifplugd are missing!";
- return -1;
- fi;
+ echo -n " ERROR: wpa_supplicant and/or ifplugd are missing!"
+ return -1
+ fi
elif [ "$MANAGER" == "ifplugd" ] ; then
if [ -x $IFPLUGD ] ; then
if ! ifplugd -c -i $1 &> /dev/null ; then
- $IFPLUGD -I -i $1 -f;
- fi;
+ $IFPLUGD -I -i $1 -f
+ fi
else
- echo -n " ERROR: ifplugd is missing!";
- fi;
+ echo -n " ERROR: ifplugd is missing!"
+ fi
elif [ "$MANAGER" == "manual" ] || [ -z "$MANAGER" ] ; then
if [ "$WIRELESS" == "Y" ] && [ -x $IWCONFIG ] ; then
if [ ! "x$WIRELESS_MODE" == "x" ] ; then
- $IWCONFIG $1 mode $WIRELESS_MODE;
- fi;
+ $IWCONFIG $1 mode $WIRELESS_MODE
+ fi
if [ ! "x$WIRELESS_KEY" == "x" ] ; then
- $IWCONFIG $1 key $WIRELESS_KEY;
- fi;
+ $IWCONFIG $1 key $WIRELESS_KEY
+ fi
if [ ! "x$WIRELESS_RATE" == "x" ] ; then
- $IWCONFIG $1 rate $WIRELESS_RATE;
- fi;
+ $IWCONFIG $1 rate $WIRELESS_RATE
+ fi
if [ ! "x$WIRELESS_ESSID" == "x" ] ; then
- $IWCONFIG $1 essid $WIRELESS_ESSID;
- fi;
+ $IWCONFIG $1 essid $WIRELESS_ESSID
+ fi
elif [ "$WIRELESS" == "Y" ] ; then
- echo -n " ERROR: wireless_tools not installed!";
- return -1;
- fi;
+ echo -n " ERROR: wireless_tools not installed!"
+ return -1
+ fi
# Assume direct DHCP/static IPs if no manager/manual is set
if [ "$ADDRESS" == "dhcp" ] && [ ! "x${DHCP_CLIENT}" == "x" ] ; then
@@ -118,65 +118,65 @@
RUNFILE=/sbin/udhcpc
DHCP_OPTIONS="$DHCP_OPTIONS -p $PIDFILE -i"
;;
- esac;
+ esac
if [ ! -x $RUNFILE ]; then
- echo -n " $DHCP_CLIENT not installed";
- return -1;
- fi;
+ echo -n " $DHCP_CLIENT not installed"
+ return -1
+ fi
if [ -e $PIDFILE ]; then
if [ $(ps ax | grep `cat $PIDFILE` | grep $DHCP_CLIENT | grep -v grep | wc -l) -ge 1 ]; then
- echo -n " $DHCP_CLIENT already started";
- return -3;
+ echo -n " $DHCP_CLIENT already started"
+ return -3
else
- rm -f $PIDFILE;
- fi;
- fi;
+ rm -f $PIDFILE
+ fi
+ fi
# This is where the magic happens
- $RUNFILE $DHCP_OPTIONS $1 > /dev/null 2>&1;
+ $RUNFILE $DHCP_OPTIONS $1 > /dev/null 2>&1
DHCP_EXIT=$?
- sleep 1;
+ sleep 1
if [ ! -e $PIDFILE ]; then
if [ $DHCP_EXIT -eq 0 ]; then
- echo -n "DHCP exited cleanly";
- return -3;
+ echo -n "DHCP exited cleanly"
+ return -3
else
- echo -n "DHCP failed";
- return -1;
- fi;
- fi;
+ echo -n "DHCP failed"
+ return -1
+ fi
+ fi
# Set a static IP if its there
elif [ ! "x${ADDRESS}" == "x" ] ; then
if [ ! "x$NETMASK" == "x" ]; then
- NETMASK="netmask $NETMASK";
- fi;
+ NETMASK="netmask $NETMASK"
+ fi
if [ ! "x$BROADCAST" == "x" ]; then
- BROADCAST="broadcast $BROADCAST";
- fi;
+ BROADCAST="broadcast $BROADCAST"
+ fi
# If there is an address then ifconfig will be able to bring up the device anyway
# so no error handling here
- $IFCONFIG $1 ${ADDRESS} $IFCONF_OPTS $NETMASK $BROADCAST up >/dev/null 2>&1;
- fi;
+ $IFCONFIG $1 ${ADDRESS} $IFCONF_OPTS $NETMASK $BROADCAST up >/dev/null 2>&1
+ fi
else
- echo -n " ERROR: No address specified and DHCP not configured!";
- return -1;
- fi;
+ echo -n " ERROR: No address specified and DHCP not configured!"
+ return -1
+ fi
# Now for the static routes
# FIXME: This is not configurable through lnet anymore
for ROUTECMD in "$ROUTE_1" "$ROUTE_2" "$ROUTE_3" "$ROUTE_4" ; do
if [ ! "x$ROUTECMD" == "x" ] ; then
- echo -e "\n adding route: $ROUTECMD";
- $ROUTE $ROUTECMD;
- fi;
- done;
+ echo -e "\n adding route: $ROUTECMD"
+ $ROUTE $ROUTECMD
+ fi
+ done
}
function device_stop()
@@ -243,27 +243,27 @@
kill `cat $PIDFILE`
else
$KILLCMD
- fi;
+ fi
if [ -e $PIDFILE ]; then
- rm -f $PIDFILE;
- fi;
- sleep 1;
+ rm -f $PIDFILE
+ fi
+ sleep 1
else
case $AUTO in
[!yY])
- echo -n " not started";
- return -1;
+ echo -n " not started"
+ return -1
;;
- esac;
- fi;
+ esac
+ fi
- $IFCONFIG $1 down;
+ $IFCONFIG $1 down
if [ -n "$MODULE" ]; then
- modprobe -r $MODULE;
- fi;
+ modprobe -r $MODULE
+ fi
}
export -f device_start device_stop
@@ -275,37 +275,37 @@
echo "Starting network:"
# Add routing entry for loopback interface
if [ ! $($ROUTE -n | grep 127.0.0.0 | wc -l) -ge 1 ]; then
- echo -n " * Starting lo: ";
- $IFCONFIG lo 127.0.0.1 netmask 255.0.0.0;
- $ROUTE add -net 127.0.0.0 netmask 255.0.0.0 dev lo;
- echo -e $RESULT_OK;
- fi;
+ echo -n " * Starting lo: "
+ $IFCONFIG lo 127.0.0.1 netmask 255.0.0.0
+ $ROUTE add -net 127.0.0.0 netmask 255.0.0.0 dev lo
+ echo -e $RESULT_OK
+ fi
for device in `ls -1 $CONFIGS | cut -d"-" -f1 | uniq`; do
- echo -n " * Starting $device: ";
- device_start $device auto;
- chkresult;
- done;
+ echo -n " * Starting $device: "
+ device_start $device auto
+ chkresult
+ done
if [ -e /etc/config.d/gateway ]; then
GATEWAY=`cat /etc/config.d/gateway`
if [ -n "$GATEWAY" ] && ! ($ROUTE -n | grep -q "^0\.0\.0\.0.*UG.*$") ; then
- echo -n " * setting default route: ";
- $ROUTE add default gateway $GATEWAY;
- fi;
+ echo -n " * setting default route: "
+ $ROUTE add default gateway $GATEWAY
+ fi
if [ `route -n | grep $GATEWAY | wc -l` -lt 1 ]; then
- echo -n "failed to set gateway";
- echo -e $RESULT_FAIL;
+ echo -n "failed to set gateway"
+ echo -e $RESULT_FAIL
else
- echo -e $RESULT_OK;
- fi;
- fi;
+ echo -e $RESULT_OK
+ fi
+ fi
else
- echo -n " * Starting $2: ";
- device_start $2;
- chkresult;
- fi;
+ echo -n " * Starting $2: "
+ device_start $2
+ chkresult
+ fi
}
stop()
@@ -351,8 +351,8 @@
;;
*)
- echo "Usage: $0 {start|stop|restart} [device]";
- exit 0;
+ echo "Usage: $0 {start|stop|restart} [device]"
+ exit 0
;;
esac
More information about the Lunar-commits
mailing list