#!/sbin/runscript
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

depend() {
        after *
}

start() {
        ebegin "(gentoo) Starting tapper program run control"

#needed for NFS
        /etc/init.d/portmap start

        STARTSCRIPT=
        FILENAME="tapper-automatic-test.pl"
        POSSIBLE_PATHS="
/mnt/opt/tapper/bin/
/opt/tapper/bin/
/home/tapper/perl510/bin/
"
        while (( 1 )); do
            for DIR in $POSSIBLE_PATHS; do
                STARTSCRIPT=${DIR}/$FILENAME
                if [[ -e $STARTSCRIPT ]]
                then
                    /sbin/ifconfig
                    ${DIR}/perl $STARTSCRIPT $*
                    exit 0
                fi
            done
            mount natrium:/vol/osrc_home/ /home
            echo "Wait for auto mount /home/tapper ..."
            sleep 2
        done

        eend $? "Failed to start local"
}

stop() {
        ebegin "Nothing to do"
}

