#
# description: Manages all PLC services on this machine
#
-# $Id: host.init,v 1.3 2006/04/07 17:12:52 mlhuang Exp $
+# $Id: host.init,v 1.4 2006/04/12 19:30:47 mlhuang Exp $
#
PATH=/sbin:/bin:/usr/bin:/usr/sbin
fi
}
-start ()
+mount_plc ()
{
echo -n $"Mounting PLC: "
check
}
-stop ()
+umount_plc ()
{
- if mounted $PLC_ROOT ; then
- chroot $PLC_ROOT /sbin/service plc $PLC_OPTIONS stop $*
- check
- fi
-
echo -n $"Unmounting PLC: "
for dir in $PLC_ROOT/proc $PLC_ROOT/data $PLC_ROOT ; do
echo
}
+stop ()
+{
+ if mounted $PLC_ROOT ; then
+ chroot $PLC_ROOT /sbin/service plc $PLC_OPTIONS stop $*
+ check
+ fi
+
+ umount_plc
+
+}
+
+mount_status ()
+{
+ lines=$(mount | grep $PLC_ROOT)
+ if [ -z "$lines" ] ; then
+ echo "==== $PLC_ROOT is *not* mounted"
+ else
+ echo "==== The following mount points remain active"
+ echo "$lines"
+ fi
+}
+
# Get command
shift $(($OPTIND - 1))
command=$1
start $*
;;
+ mount|umount)
+ ${command}_plc $*
+ ;;
+
+ mountstatus)
+ mount_status $*
+ ;;
+
*)
echo "Usage: $0 {start|stop|restart}"
RETVAL=1