allow stepwise start/stop
authorMark Huang <mlhuang@cs.princeton.edu>
Wed, 12 Apr 2006 19:30:47 +0000 (19:30 +0000)
committerMark Huang <mlhuang@cs.princeton.edu>
Wed, 12 Apr 2006 19:30:47 +0000 (19:30 +0000)
host.init

index cba4101..5c22f9c 100755 (executable)
--- a/host.init
+++ b/host.init
@@ -6,7 +6,7 @@
 #
 # description: Manages all PLC services on this machine
 #
-# $Id: host.init,v 1.2 2006/03/27 22:01:36 mlhuang Exp $
+# $Id: host.init,v 1.3 2006/04/07 17:12:52 mlhuang Exp $
 #
 
 PATH=/sbin:/bin:/usr/bin:/usr/sbin
@@ -60,14 +60,14 @@ start ()
     [ $ERRORS -eq 0 ] && success $"PLC unmount" || failure $"PLC unmount"      
     echo
 
-    chroot $PLC_ROOT /sbin/service plc $PLC_OPTIONS start
+    chroot $PLC_ROOT /sbin/service plc $PLC_OPTIONS start $*
     check
 }
 
 stop ()
 {
     if mounted $PLC_ROOT ; then
-       chroot $PLC_ROOT /sbin/service plc $PLC_OPTIONS stop
+       chroot $PLC_ROOT /sbin/service plc $PLC_OPTIONS stop $*
        check
     fi
 
@@ -84,14 +84,21 @@ stop ()
     echo
 }
 
-case "$1" in
+# Get command
+shift $(($OPTIND - 1))
+command=$1
+
+# Get step(s)
+shift 1
+
+case "$command" in
     start|stop)
-       $1
+       $command $*
        ;;
 
     restart)
-       stop
-       start
+       stop $*
+       start $*
        ;;
 
     *)