]> git.pld-linux.org Git - packages/util-vserver.git/blobdiff - vrootdevices.init
- up to pre3126
[packages/util-vserver.git] / vrootdevices.init
old mode 100644 (file)
new mode 100755 (executable)
index 568b3b1..816eb62
@@ -8,11 +8,9 @@
 # Source function library
 . /etc/rc.d/init.d/functions
 
-[ -f /etc/sysconfig/vrootdevices ] && . /etc/sysconfig/vrootdevices
-
-function assign_vroot()
+assign_vroot()
 {
-       cat /etc/sysconfig/rawdevices | egrep -v '^ *#' | while read VROOT BLOCK; do
+       cat /etc/sysconfig/vrootdevices | egrep -v '^ *#' | while read VROOT BLOCK; do
        if [ -n "$VROOT" -a -n "$BLOCK" ]; then
                if [ -d /dev/vroot ]; then
                        VROOT="/dev/vroot/$VROOT"
@@ -27,9 +25,9 @@ function assign_vroot()
        done
 }
 
-function remove_vroot()
+remove_vroot()
 {
-       cat /etc/sysconfig/rawdevices | egrep -v '^ *#' | while read VROOT BLOCK; do
+       cat /etc/sysconfig/vrootdevices | egrep -v '^ *#' | while read VROOT BLOCK; do
        if [ -n "$VROOT" -a -n "$BLOCK" ]; then
                if [ -d /dev/vroot ]; then
                        VROOT="/dev/vroot/$VROOT"
@@ -44,8 +42,7 @@ function remove_vroot()
        done
 }
 
-case "$1" in
-  start|reload)
+start() {
        if [ ! -f /var/lock/subsys/vrootdevices ]; then
                msg_starting vrootdevices
                ok
@@ -54,9 +51,9 @@ case "$1" in
        else
                msg_already_running vrootdevices
        fi
+}
 
-       ;;
-  stop)
+stop() {
        if [ -f /var/lock/subsys/vrootdevices ]; then
                msg_stopping vrootdevices
                ok
@@ -65,26 +62,26 @@ case "$1" in
        else
                msg_not_running vrootdevices
        fi
+}
+
+case "$1" in
+  start|reload)
+       start
        ;;
-  status)
-       ID=`id -u`
-       if [ $ID -eq 0 ]; then
-               echo "There is no way to tell"
-       else
-               # don't remove the space at the end!!!
-               nls "You need to be root to use this command ! "
-       fi
+  stop)
+       stop
        ;;
   restart|force-reload)
-       $0 stop
-       $0 start
+       stop
+       start
+       ;;
+  status)
+       echo "There is no way to tell"
+       ;;
   *)
-       echo "Usage: $0 {start|stop|restart|reload|force-reload|status}"
+       msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
        exit 3
        ;;
 esac
 
 exit $RETVAL
-
-# This must be last line !
-# vi:syntax=sh
This page took 0.121467 seconds and 4 git commands to generate.