[Clfs-commits] commit: r40 - in /trunk/embedded: LICENSE clfs/rc.d/init.d/functions clfs/rc.d/init.d/network clfs/rc.d/init.d/sshd clfs/rc.d/init.d/syslog clfs/rc.d/shutdown clfs/rc.d/startup

svn at cross-lfs.org svn at cross-lfs.org
Sat Jan 31 10:18:41 PST 2009


Author: jim
Date: Sat Jan 31 18:18:40 2009
New Revision: 40

Log:
Formatting change to embedded

Modified:
    trunk/embedded/LICENSE
    trunk/embedded/clfs/rc.d/init.d/functions
    trunk/embedded/clfs/rc.d/init.d/network
    trunk/embedded/clfs/rc.d/init.d/sshd
    trunk/embedded/clfs/rc.d/init.d/syslog
    trunk/embedded/clfs/rc.d/shutdown
    trunk/embedded/clfs/rc.d/startup

Modified: trunk/embedded/LICENSE
==============================================================================
--- trunk/embedded/LICENSE (original)
+++ trunk/embedded/LICENSE Sat Jan 31 18:18:40 2009
@@ -1,4 +1,4 @@
-Copyright (c) 2007 Jim Gifford and Ryan Oliver
+Copyright (c) 2007-2009 Jim Gifford and Ryan Oliver
 
 Permission is hereby granted, free of charge, to any person obtaining
 a copy of this software and associated documentation files (the

Modified: trunk/embedded/clfs/rc.d/init.d/functions
==============================================================================
--- trunk/embedded/clfs/rc.d/init.d/functions (original)
+++ trunk/embedded/clfs/rc.d/init.d/functions Sat Jan 31 18:18:40 2009
@@ -10,12 +10,12 @@
 #
 check_status()
 {
-	local ERR=$?
-	echo -en "\\033[65G"
-	if [ $ERR = 0 ]; then
-		echo -en "\\033[1;32mOK"
-	else
-		echo -en "\\033[1;31mFAIL"
-	fi
-	echo -e "\\033[0;39m"
+  local ERR=$?
+  echo -en "\\033[65G"
+  if [ $ERR = 0 ]; then
+    echo -en "\\033[1;32mOK"
+  else
+    echo -en "\\033[1;31mFAIL"
+  fi
+  echo -e "\\033[0;39m"
 }

Modified: trunk/embedded/clfs/rc.d/init.d/network
==============================================================================
--- trunk/embedded/clfs/rc.d/init.d/network (original)
+++ trunk/embedded/clfs/rc.d/init.d/network Sat Jan 31 18:18:40 2009
@@ -9,67 +9,65 @@
 . /etc/network.conf
 
 if [ "$NETWORKING" != "yes" ]; then
-	echo "Networking is disabled in /etc/network.conf"
-	exit 0
+  echo "Networking is disabled in /etc/network.conf"
+  exit 0
 fi
 
 case "$1" in
 start)
-	for i in /etc/network.d/interface.*
-	do
-		if [ -r "$i" ]; then
-			. $i
-			if [ "$DHCP" = "yes" ]; then
-				echo -n "Starting DHCP for interface $INTERFACE: "
-				udhcpc -b -i "$INTERFACE" \
-					-p "/var/run/udhcpc.$INTERFACE.pid" \
-					> /dev/null
-			else
-				echo -n "Setting up interface $INTERFACE: "
-				ifconfig "$INTERFACE" "$IPADDRESS" \
-					netmask "$NETMASK" \
-					broadcast "$BROADCAST" up
-			fi
-			check_status
-	  	fi
-	done
+  for i in /etc/network.d/interface.*; do
+    if [ -r "$i" ]; then
+      . $i
+      if [ "$DHCP" = "yes" ]; then
+        echo -n "Starting DHCP for interface $INTERFACE: "
+        udhcpc -b -i "$INTERFACE" \
+          -p "/var/run/udhcpc.$INTERFACE.pid" \
+          > /dev/null
+      else
+        echo -n "Setting up interface $INTERFACE: "
+        ifconfig "$INTERFACE" "$IPADDRESS" \
+          netmask "$NETMASK" \
+          broadcast "$BROADCAST" up
+      fi
+        check_status
+    fi
+  done
 	
-	if [ "$USE_GATEWAY" = "yes" -a -n "$GATEWAY" ]; then
-		echo -n "Setting default route: "
-		route add default gw $GATEWAY
-		check_status
-	fi
-	;;
+  if [ "$USE_GATEWAY" = "yes" -a -n "$GATEWAY" ]; then
+    echo -n "Setting default route: "
+    route add default gw $GATEWAY
+    check_status
+  fi
+;;
 stop)
-	if [ "$USE_GATEWAY" = "yes" -a -n "$GATEWAY" ]; then
-		echo -n "Removing default route: "
-		route del -net 0.0.0.0
-		check_status
-	fi
+  if [ "$USE_GATEWAY" = "yes" -a -n "$GATEWAY" ]; then
+    echo -n "Removing default route: "
+    route del -net 0.0.0.0
+    check_status
+  fi
 
-	for i in /etc/network.d/interface.*
-	do
-		if [ -r "$i" ]; then
-			. $i
-			echo -n "Shutting down interface $INTERFACE: "
-			ifconfig $INTERFACE down
-			check_status
-			if [ "$DHCP" = "yes" ]; then
-				kill `cat "/var/run/udhcpc.$INTERFACE.pid"`
-				sleep 1
-			fi
-		fi
-	done
-	;;
+  for i in /etc/network.d/interface.*; do
+    if [ -r "$i" ]; then
+    . $i
+    echo -n "Shutting down interface $INTERFACE: "
+    ifconfig $INTERFACE down
+    check_status
+    if [ "$DHCP" = "yes" ]; then
+      kill `cat "/var/run/udhcpc.$INTERFACE.pid"`
+      sleep 1
+    fi
+  fi
+  done
+;;
 restart)
-	$0 stop
-	$0 start
-	;;
+  $0 stop
+  $0 start
+;;
 status)
-	ifconfig
-	route
-	;;
+  ifconfig
+  route
+;;
 *)
-	echo "Usage: $0 {start|stop|restart|status}"
-	exit 1
+  echo "Usage: $0 {start|stop|restart|status}"
+  exit 1
 esac

Modified: trunk/embedded/clfs/rc.d/init.d/sshd
==============================================================================
--- trunk/embedded/clfs/rc.d/init.d/sshd (original)
+++ trunk/embedded/clfs/rc.d/init.d/sshd Sat Jan 31 18:18:40 2009
@@ -10,45 +10,45 @@
 
 case "$1" in
 start)
-	if [ ! -r "$DSSKEY" ]; then
-		echo -n "Generating DSS host key: "
-		dropbearkey -t dss -f "$DSSKEY" >/dev/null 2>&1
-		check_status
-	fi
-	if [ ! -r "$RSAKEY" ]; then
-		echo -n "Generating RSA host key: "
-		dropbearkey -t rsa -f "$RSAKEY" >/dev/null 2>&1
-		check_status
-	fi
-	if [ -r "$PIDFILE" ]; then
-		echo "Service dropbear already running."
-	else
-		echo -n "Starting SSH server: "
-		dropbear
-		check_status
-	fi
-	;;
+  if [ ! -r "$DSSKEY" ]; then
+    echo -n "Generating DSS host key: "
+    dropbearkey -t dss -f "$DSSKEY" >/dev/null 2>&1
+    check_status
+  fi
+  if [ ! -r "$RSAKEY" ]; then
+    echo -n "Generating RSA host key: "
+    dropbearkey -t rsa -f "$RSAKEY" >/dev/null 2>&1
+    check_status
+  fi
+  if [ -r "$PIDFILE" ]; then
+    echo "Service dropbear already running."
+  else
+    echo -n "Starting dropbear SSH server: "
+    dropbear
+    check_status
+  fi
+;;
 stop)
-	if [ -r "$PIDFILE" ]; then
-		echo -n "Stopping dropbear SSH server: "
-		kill `cat "$PIDFILE"`
-		check_status
-	else
-		echo "Service dropbear not running."
-	fi
-	;;
+  if [ -r "$PIDFILE" ]; then
+    echo -n "Stopping dropbear SSH server: "
+    kill `cat "$PIDFILE"`
+    check_status
+  else
+    echo "Service dropbear not running."
+  fi
+;;
 restart)
-	$0 stop
-	$0 start
-	;;
+  $0 stop
+  $0 start
+;;
 status)
-	if [ -r "$PIDFILE" ]; then
-		echo "Service dropbear running (PID $(cat "$PIDFILE"))."
-	else
-		echo "Service dropbear not running."
-	fi
-	;;
+  if [ -r "$PIDFILE" ]; then
+    echo "Service dropbear running (PID $(cat "$PIDFILE"))."
+  else
+    echo "Service dropbear not running."
+  fi
+;;
 *)
-	echo "Usage: $0 {start|stop|restart|status}"
-	exit 1
+  echo "Usage: $0 {start|stop|restart|status}"
+  exit 1
 esac

Modified: trunk/embedded/clfs/rc.d/init.d/syslog
==============================================================================
--- trunk/embedded/clfs/rc.d/init.d/syslog (original)
+++ trunk/embedded/clfs/rc.d/init.d/syslog Sat Jan 31 18:18:40 2009
@@ -9,26 +9,26 @@
 
 case "$1" in
 start)
-	echo -n "Starting syslogd: "
-	syslogd -m 0 -s $SYSLOG_ROTATE_SIZE -L
-	check_status
-	echo -n "Starting klogd: "
-	klogd
-	check_status
-	;;
+  echo -n "Starting syslogd: "
+  syslogd -m 0 -s $SYSLOG_ROTATE_SIZE -L
+  check_status
+  echo -n "Starting klogd: "
+  klogd
+  check_status
+;;
 stop)
-	echo -n "Stopping klogd: "
-	killall klogd
-	check_status
-	echo -n "Stopping syslogd: "
-	killall syslogd
-	check_status
-	;;
+  echo -n "Stopping klogd: "
+  killall klogd
+  check_status
+  echo -n "Stopping syslogd: "
+  killall syslogd
+  check_status
+;;
 restart)
-	$0 stop
-	$0 start
-	;;
+  $0 stop
+  $0 start
+;;
 *)
-	echo "Usage: $0 {start|stop|restart}"
-	exit 1
+  echo "Usage: $0 {start|stop|restart}"
+  exit 1
 esac

Modified: trunk/embedded/clfs/rc.d/shutdown
==============================================================================
--- trunk/embedded/clfs/rc.d/shutdown (original)
+++ trunk/embedded/clfs/rc.d/shutdown Sat Jan 31 18:18:40 2009
@@ -9,14 +9,12 @@
 echo "System is going down for reboot or halt now."
 echo
 
-
 echo "Starting stop scripts."
 
-for i in /etc/rc.d/stop/*
-do
-	if [ -x $i ]; then
-		$i stop
-	fi
+for i in /etc/rc.d/stop/*; do
+  if [ -x $i ]; then
+    $i stop
+  fi
 done
 
 echo -n "Syncing hardware clock to system clock:"

Modified: trunk/embedded/clfs/rc.d/startup
==============================================================================
--- trunk/embedded/clfs/rc.d/startup (original)
+++ trunk/embedded/clfs/rc.d/startup Sat Jan 31 18:18:40 2009
@@ -19,17 +19,17 @@
 echo "Starting fsck for root filesystem."
 fsck -T -C /
 if [ "$?" -gt 2 ]; then
-	echo "WARNING: Errors found while checking root filesystem."
-	echo "You can login as root now, the system will reboot after logout."
-	sulogin
-	reboot
+  echo "WARNING: Errors found while checking root filesystem."
+  echo "You can login as root now, the system will reboot after logout."
+  sulogin
+  reboot
 elif [ "$?" = "2" ]; then
-	echo "NOTICE: System needs to be rebooted now."
-	sleep 1
-	reboot
+  echo "NOTICE: System needs to be rebooted now."
+  sleep 1
+  reboot
 else
-	echo -n "Checking root filesystem: "
-	check_status
+  echo -n "Checking root filesystem: "
+  check_status
 fi
 
 echo -n "Remounting root rw: "
@@ -43,17 +43,17 @@
 echo "Starting fsck for local filesystems."
 fsck -A -C -R -T -t nonfs,nosmbfs
 if [ "$?" -gt 2 ]; then
-	echo "WARNING: Errors found while checking filesystems."
-	echo "You can login as root now, the system will reboot after logout."
-	sulogin
-	reboot
+  echo "WARNING: Errors found while checking filesystems."
+  echo "You can login as root now, the system will reboot after logout."
+  sulogin
+  reboot
 elif [ "$?" = "2" ]; then
-	echo "NOTICE: System needs to be rebooted now."
-	sleep 1
-	reboot
+  echo "NOTICE: System needs to be rebooted now."
+  sleep 1
+  reboot
 else
-	echo -n "Checking local filesystems: "
-	check_status
+  echo -n "Checking local filesystems: "
+  check_status
 fi
 
 echo -n "Enabling swap space: "
@@ -81,9 +81,8 @@
 
 echo "Running start scripts."
 
-for i in /etc/rc.d/start/*
-do
-	if [ -x $i ]; then
-		$i start
-	fi
+for i in /etc/rc.d/start/*; do
+  if [ -x $i ]; then
+    $i start
+  fi
 done




More information about the Clfs-commits mailing list