From 8829238904f8adc45d3412ae8d3af8329dca2e3e Mon Sep 17 00:00:00 2001 From: Mark Huang Date: Wed, 12 Apr 2006 19:30:47 +0000 Subject: [PATCH] allow stepwise start/stop --- host.init | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/host.init b/host.init index cba4101..5c22f9c 100755 --- 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 $* ;; *) -- 2.43.0