SOURCES: vprocunhide.init - pldize; use functions

glen glen at pld-linux.org
Tue Jul 3 20:21:53 CEST 2007


Author: glen                         Date: Tue Jul  3 18:21:53 2007 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- pldize; use functions

---- Files affected:
SOURCES:
   vprocunhide.init (1.5 -> 1.6) 

---- Diffs:

================================================================
Index: SOURCES/vprocunhide.init
diff -u SOURCES/vprocunhide.init:1.5 SOURCES/vprocunhide.init:1.6
--- SOURCES/vprocunhide.init:1.5	Tue Nov 22 19:01:37 2005
+++ SOURCES/vprocunhide.init	Tue Jul  3 20:21:47 2007
@@ -15,8 +15,7 @@
 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 @@
 		*)	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 @@
 	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
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/vprocunhide.init?r1=1.5&r2=1.6&f=u



More information about the pld-cvs-commit mailing list