]> git.pld-linux.org Git - packages/util-vserver.git/commitdiff
- pldize; use functions
authorElan Ruusamäe <glen@pld-linux.org>
Tue, 3 Jul 2007 18:21:47 +0000 (18:21 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    vprocunhide.init -> 1.6

vprocunhide.init

index a89b724664fa650dfb06c2d641c2adf40f863b63..189f5b9fb39c296f0b5603a556e8332239668f55 100644 (file)
@@ -15,8 +15,7 @@ if [ ! -e "$UTIL_VSERVER_VARS" ] ; then
 fi
 . "$UTIL_VSERVER_VARS"
 
-case "$1" in
-start)
+start() {
        if [ ! -d /proc/virtual ]; then
                show "Fixing vservers /proc entries visibility. kernel not capable"
                fail
@@ -35,17 +34,26 @@ start)
                *)      fail;;
        esac
        [ "$RETVAL" -eq 0 ] && touch /var/lock/subsys/vprocunhide
-       ;;
-stop)
+}
+
+stop() {
        show "Stopping vservers /proc entries visibility"
        busy
        ${_SETATTR} -Rx --hide /proc
        rm -f /var/lock/subsys/vprocunhide
        ok
+}
+
+case "$1" in
+start)
+       start
+       ;;
+stop)
+       stop
        ;;
 restart|reload)
-       $0 stop
-       $0 start
+       stop
+       start
        ;;
 status)
        if [ -f /var/lock/subsys/vprocunhide ] ; then
@@ -55,12 +63,9 @@ status)
        fi
        ;;
 *)
-       echo "Usage: $0 {start|stop|reload|restart|status}"
-       exit 1
+       msg_usage "$0 {start|stop|reload|restart|status}"
+       exit 3
        ;;
 esac
 
 exit $RETVAL
-
-# This must be last line !
-# vi:syntax=sh:tw=78:ts=4:sw=4
This page took 0.038124 seconds and 4 git commands to generate.