git://git.onelab.eu
/
myplc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
793ea68
)
allow stepwise start/stop
author
Mark Huang
<mlhuang@cs.princeton.edu>
Wed, 12 Apr 2006 19:30:47 +0000
(19:30 +0000)
committer
Mark Huang
<mlhuang@cs.princeton.edu>
Wed, 12 Apr 2006 19:30:47 +0000
(19:30 +0000)
host.init
patch
|
blob
|
history
diff --git
a/host.init
b/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
#
#
# 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
#
PATH=/sbin:/bin:/usr/bin:/usr/sbin
@@
-60,14
+60,14
@@
start ()
[ $ERRORS -eq 0 ] && success $"PLC unmount" || failure $"PLC unmount"
echo
[ $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
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
check
fi
@@
-84,14
+84,21
@@
stop ()
echo
}
echo
}
-case "$1" in
+# Get command
+shift $(($OPTIND - 1))
+command=$1
+
+# Get step(s)
+shift 1
+
+case "$command" in
start|stop)
start|stop)
- $
1
+ $
command $*
;;
restart)
;;
restart)
- stop
- start
+ stop
$*
+ start
$*
;;
*)
;;
*)