[Lunar-commits] r18790 - in moonbase/trunk/net/net-tools: . init.d

Auke Kok sofar at lunar-linux.org
Sat Feb 18 21:08:11 UTC 2006


Author: sofar
Date: 2006-02-18 21:08:06 +0000 (Sat, 18 Feb 2006)
New Revision: 18790

Modified:
   moonbase/trunk/net/net-tools/BUILD
   moonbase/trunk/net/net-tools/POST_INSTALL
   moonbase/trunk/net/net-tools/init.d/hostname
Log:
Cleanup this module: make init.d/hostname tracked, remove old crufties and bad constructs.


Modified: moonbase/trunk/net/net-tools/BUILD
===================================================================
--- moonbase/trunk/net/net-tools/BUILD	2006-02-18 19:41:05 UTC (rev 18789)
+++ moonbase/trunk/net/net-tools/BUILD	2006-02-18 21:08:06 UTC (rev 18790)
@@ -1,42 +1,22 @@
+(
+
   patch_it  $SOURCE_CACHE/$SOURCE2 1                &&
   patch_it  $SOURCE_CACHE/$SOURCE3 0                &&
 
-if  [  -f  $CONFIG_CACHE/net-tools.config.h  ];  then
-  cp       $CONFIG_CACHE/net-tools.config.h  config.h
-else
-  ./configure.sh  config.in
-  cp  config.h  $CONFIG_CACHE/net-tools.config.h
-fi
+  if [ -f $CONFIG_CACHE/net-tools.config.h ]; then
+    cp $CONFIG_CACHE/net-tools.config.h config.h
+  else
+    ./configure.sh config.in
+    cp config.h $CONFIG_CACHE/net-tools.config.h
+  fi                                                &&
 
-(
-
-  #sedit  "s:-g #:$CFLAGS $LDFLAGS #:"  Makefile
-  #sedit  "s:LOPTS =:LOPTS = -lintl:" Makefile
-  
   make                                              &&
   prepare_install                                   &&
-  make  BASEDIR=/  install
-
-) > $C_FIFO 2>&1  &&  (
-
-  #cleanup the old garbage
-  if [ -e /etc/init.d/hostname.sh ]; then
-     rm -f /etc/init.d/hostname.sh
+  make BASEDIR=/ install                            &&
+  
+  if [ ! -e /etc/init.d/hostname ]; then
+    install -m0755 $SCRIPT_DIRECTORY/init.d/hostname /etc/init.d/hostname &&
+	ln -sf /etc/init.d/hostname /etc/rcS.d/S20hostname
   fi
 
-  if  [  -e  /etc/init.d/networking.sh  ]; then
-      mv /etc/init.d/networking.sh /etc/init.d/networking.old
-      chmod 0644 networking.old
-  fi
-
-  rm -f /etc/rc?.d/???networking.sh
-
-  #add the new
-  cp  $SCRIPT_DIRECTORY/init.d/hostname    /etc/init.d
-
-  if [ -e /etc/rcS.d/S20hostname ]; then
-     rm -f /etc/rcS.d/S20hostname
-  fi   
-  ln     -sf    ../init.d/hostname  /etc/rcS.d/S20hostname
-
-)
+) > $C_FIFO 2>&1

Modified: moonbase/trunk/net/net-tools/POST_INSTALL
===================================================================
--- moonbase/trunk/net/net-tools/POST_INSTALL	2006-02-18 19:41:05 UTC (rev 18789)
+++ moonbase/trunk/net/net-tools/POST_INSTALL	2006-02-18 21:08:06 UTC (rev 18790)
@@ -1,21 +1,9 @@
-if [ ! -d /etc/config.d ]; then
-    mkdir /etc/config.d
-fi
-if [ ! -d /etc/config.d/network ]; then
-    mkdir /etc/config.d/network
-fi
-if [ ! -d /etc/config.d/bonding ]; then
-    mkdir /etc/config.d/bonding
-fi
-if [ ! -d /var/run ]; then
-    mkdir /var/run
-fi;
 
-. $MODULE_CONFIG
+mkdir -p /etc/config.d/{network,bonding}
+mkdir -p /var/run
 
-if [ "$RUN_LNET" == "y" ]; then
-   sedit "s/RUN_LNET=\"y\"/RUN_LNET=\"n\"/" $MODULE_CONFIG
-  	/usr/sbin/lnet
+if [ "$(get_module_config RUN_LNET)" == "y" ]; then
+	unset_module_config RUN_LNET
+	/usr/sbin/lnet || true
 fi
 
-true

Modified: moonbase/trunk/net/net-tools/init.d/hostname
===================================================================
--- moonbase/trunk/net/net-tools/init.d/hostname	2006-02-18 19:41:05 UTC (rev 18789)
+++ moonbase/trunk/net/net-tools/init.d/hostname	2006-02-18 21:08:06 UTC (rev 18790)
@@ -4,30 +4,22 @@
 #            init process and to setup the loopback interface
 #
 
-HNAME=$(which hostname)
-DNAME=$(which domainname) 
-HCFG="/etc/hostname"
-DCFG="/etc/domainname"
-CUTIT_HOST="cat $HCFG"
-CUTIT_DOMAIN="cat $DCFG"
-LOCAL="localhost"
-IFC=$(which ifconfig)
+case $1 in
+	start)
+		if ! [ -e "/etc/hostname" ]; then
+			HOSTNAME=localhost
+		else
+			HOSTNAME=$(cat /etc/hostname)
+		fi
+		hostname -F /etc/hostname
+		echo "Hostname set to \"$HOSTNAME\""
+		
+		if ! [ -e "/etc/domainname" ]; then
+   			echo "Domainname not set"
+		else
+			domainname -F /etc/domainname
+			echo "System Domainname set to \"$(cat /etc/domainname)\""
+		fi
+		;;
+esac
 
-if ! [ -e "$HCFG" ]; then
-	$HNAME $LOCAL
-	echo " System hostname set to $LOCAL"
-else
-	$HNAME -F $HCFG
-	echo " System hostname set to `$CUTIT_HOST`"
-fi
-
-if ! [ -e "$DCFG" ]; then
-   echo " Domainname not set"
-else
-   $DNAME -F $DCFG
-	echo " System Domainname set to `$CUTIT_DOMAIN`"
-fi
-
-$IFC  lo  127.0.0.1
-
-exit 0



More information about the Lunar-commits mailing list