#!/bin/sh

##
# Local filesystems
##

. /etc/rc.common

StartService ()
{
    if [ ! -f /var/db/volinfo.database ]; then Uninitialized_VSDB=-YES-; fi

    ConsoleMessage "Checking disks"
    /sbin/autodiskmount -va

	while true
	do
		disktool -r | awk '/FAIL/ { exit 1 }' > /dev/null && break
		echo "Waiting for autodiskmount..."
		sleep 1
	done

    if [ "${Uninitialized_VSDB:=-NO-}" = "-YES-" ]; then vsdbutil -i; fi
}

StopService ()
{
    return 0;
}

RestartService ()
{
    return 0;
}

RunService "$1"
