Ok or put this in the startup script
Code:
printERROR() {
echo "ERROR:" $@ >&2
}
getPID() {
if [ $# -lt 1 ]; then
printERROR "Insufficient Arguments."
return 1
fi
/bin/ps -ax | grep "$1" |grep -v grep | awk '{print $1;}'
}
and then at the end of the script do a
getPID command > savefile and then use php to toss it into a database, using > rather than >> will overwrite the file with the new information so in theory it should always be the current pid of the last executed script. Lemme think some more on this. I am sure there is a good solution