#!/bin/sh # /opt/piapi/go_pistart # script to initialize PI startup # This script should be started from /etc/fox/user_apps.dat # revision 1.4 / April 6, 2005 / R.Deen-Invensys # Added "nohup" to pistart command. # Added pistop to cleanup before pistart # Added check for foxapi process # In English now PIHOME=/opt/piapi ; export PIHOME cd $PIHOME/bin LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PIHOME/lib ; export LD_LIBRARY_PATH #echo $PIHOME #echo $LD_LIBRARY_PATH echo `pwd` # Before starting PI, FoxAPI must be up and running while [ `ps -ef|grep foxapi | grep -v grep |wc -l` -lt 4 ] do echo "FoxAPI not running yet, wait 10 sec. and retry" sleep 10 done echo "FoxAPI is running." echo "Stopping the PI software for a clean start..." $PIHOME/bin/pistop sleep 10 echo "Starting the PI software..." nohup $PIHOME/bin/pistart