#!/bin/bash
loadavg=`uptime | awk '{print $10}'`
# bash doesn't understand floating point
# so convert the number to an interger
thisloadavg=`echo $loadavg|awk -F \. '{print $1}'`
if [ "$thisloadavg" -ge "10" ]; then
 echo "Busy - Load Average $loadavg ($thisloadavg) "
else
 cd /var/www/html/dorada.co.uk/api
 /usr/bin/php pushNotificationsQueueWriter.php
 timeout 300 /usr/bin/php pushNotificationsSender.php
fi
