[Lunar-commits] <moonbase> lunar-init: Fixes for bash4

Stefan Wold ratler at lunar-linux.org
Sun Nov 1 12:07:53 CET 2009


commit 583e764f4f5920d5126b2a99057a7a5d77a09ad6
Author: Stefan Wold <ratler at lunar-linux.org>
Date:   Sun Nov 1 12:07:53 2009 +0100

    lunar-init: Fixes for bash4
---
 utils/lunar-init/DETAILS |    4 ++--
 utils/lunar-init/network |   24 ++++++++++++------------
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/utils/lunar-init/DETAILS b/utils/lunar-init/DETAILS
index e7e67d2..19107a0 100644
--- a/utils/lunar-init/DETAILS
+++ b/utils/lunar-init/DETAILS
@@ -1,8 +1,8 @@
           MODULE=lunar-init
-         VERSION=0.1.2
+         VERSION=0.1.3
         WEB_SITE=http://lunar-linux.org
          ENTERED=20070404
-         UPDATED=20081023
+         UPDATED=20091101
            SHORT="the Lunar init scripts vital to any system"
 PROFILE=yes
 
diff --git a/utils/lunar-init/network b/utils/lunar-init/network
index 0ab9c6c..c603df0 100644
--- a/utils/lunar-init/network
+++ b/utils/lunar-init/network
@@ -18,9 +18,9 @@ PPPD=$(which pppd 2> /dev/null)
 
 chkresult()
 {
-	if [ $? -eq "-1" ] ; then
+	if [ $? -eq "255" ] ; then
 		echo -e $RESULT_FAIL
-	elif [ $? -eq "-3" ]; then
+	elif [ $? -eq "253" ]; then
 		echo -e $RESULT_WARN
 	else
 		echo -e $RESULT_OK
@@ -53,13 +53,13 @@ function start_dhcp()
 
 	if [ ! -x $RUNFILE ]; then
 		echo -n " $DHCP_CLIENT not installed"
-		return -1
+		return 255
 	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
+			return 253
 		else
 			rm -f $PIDFILE
 		fi
@@ -73,10 +73,10 @@ function start_dhcp()
 	if [ ! -e $PIDFILE ]; then
 		if [ $DHCP_EXIT -eq 0 ]; then
 			echo -n "DHCP exited cleanly"
-			return -3
+			return 253
 		else
 			echo -n "DHCP failed"
-			return -1
+			return 255
 		fi
 	fi
 }
@@ -130,7 +130,7 @@ function device_start()
 		case "$AUTO" in
 		    [!yY])
 		    echo -n "not started automatically"
-			return -2
+			return 254
 		    ;;
 		esac
 	fi
@@ -166,7 +166,7 @@ function device_start()
 
 		else
 			echo -n " ERROR: wpa_supplicant and/or ifplugd are missing!"
-			return -1
+			return 255
 		fi
 
 	elif [ "$MANAGER" == "ifplugd" ] ; then
@@ -207,7 +207,7 @@ function device_start()
 			fi
 		elif [ "$WIRELESS" == "Y" ] ; then
 			echo -n " ERROR: wireless_tools not installed!"
-			return -1
+			return 255
 		fi
 	  
 		# Assume direct DHCP/static IPs if no manager/manual is set
@@ -228,7 +228,7 @@ function device_start()
 		fi
 	else
 		echo -n " ERROR: No address specified and DHCP not configured!"
-		return -1
+		return 255
 	fi
 
 	# Now for the static routes
@@ -246,7 +246,7 @@ function device_stop()
 {
 	if [ ! -e "$CONFIGS/$1" ]; then
 		echo -n " missing config for $1"
-		return -1
+		return 255
 	fi
 
 	# Source configuration file
@@ -268,7 +268,7 @@ function device_stop()
 		case $AUTO in
 		    [!yY])
 			echo -n " not started"
-			return -1
+			return 255
 		    ;;
 		esac
 	fi


More information about the Lunar-commits mailing list