#!/bin/bash

PIDFILE=/home/vaxproappt/public_html/$1$2.pid
#echo $PIDFILE
if [ -f $PIDFILE ]
then
  PID=$(cat $PIDFILE)
  ps -p $PID > /dev/null 2>&1
  if [ $? -eq 0 ]
  then
    echo "Process already running"
    exit 1
  else
    ## Process not found assume not running
    echo $$ > $PIDFILE
    if [ $? -ne 0 ]
    then
      echo "Could not create PID file"
      exit 1
    fi
  fi
else
  echo $$ > $PIDFILE
  if [ $? -ne 0 ]
  then
    echo "Could not create PID file"
    exit 1
  fi
fi
/usr/bin/php /home/vaxproappt/public_html/src/Millietestcron.php
/usr/bin/php /home/vaxproappt/public_html/src/second_set_reminder.php
/usr/bin/php /home/vaxproappt/public_html/src/third_set_reminder.php

rm $PIDFILE