]> git.pld-linux.org Git - packages/util-linux.git/blobdiff - rawdevices.init
- do really nothing without config
[packages/util-linux.git] / rawdevices.init
index b665d4b1f34b8fd6c532239a97995e3522a0e09c..739ec4c4bd032c891ddcf876dd6c629fbc553763 100644 (file)
@@ -25,8 +25,8 @@ PATH=/usr/bin:/bin:/usr/sbin:/sbin
 
 function assign_raw()
 {
-       cat /etc/sysconfig/rawdevices | egrep -v '^ *#' | while read RAW BLOCK; do 
-       if [ -n "$RAW" -a -n "$BLOCK" ]; then 
+       cat /etc/sysconfig/rawdevices | egrep -v '^ *#' | while read RAW BLOCK; do
+       if [ -n "$RAW" -a -n "$BLOCK" ]; then
                if [ "`dirname $RAW`" = "/dev" -a -d /dev/raw ]; then
                        nls " Please correct your /etc/sysconfig/rawdevices:"
                        nls " rawdevices are now located in the directory /dev/raw/ "
@@ -50,10 +50,7 @@ function assign_raw()
        done
 }
 
-
-# See how we were called.
-case "$1" in
-  start|reload)
+start() {
        if [ ! -f /var/lock/subsys/rawdevices ]; then
                msg_starting rawdevices
                ok
@@ -62,8 +59,9 @@ case "$1" in
        else
                msg_already_running rawdevices
        fi
-       ;;
-  stop)
+}
+
+stop() {
        if [ -f /var/lock/subsys/rawdevices ]; then
                msg_stopping rawdevices
                busy
@@ -72,10 +70,19 @@ case "$1" in
        else
                msg_not_running rawdevices
        fi
+}
+
+# See how we were called.
+case "$1" in
+  start|reload)
+       start
+       ;;
+  stop)
+       stop
        ;;
   status)
-       ID=`id -u`
-       if [ $ID -eq 0 ]; then 
+       id=`id -u`
+       if [ "$id" -eq 0 ]; then
                raw -qa
        else
                # don't remove the space at the end!!!
@@ -83,8 +90,8 @@ case "$1" in
        fi
        ;;
   restart|force-reload)
-       $0 stop
-       $0 start
+       stop
+       start
        ;;
 
   *)
This page took 0.097638 seconds and 4 git commands to generate.