#!/bin/bash
#
# @(#) Generate charts for a single HP receiver.
#
FSEM="/tmp/chartsemaphore"
#
if [[ -f $FSEM ]]
then
	echo "Previous chart already running"
	exit
fi
#
# This whee the EFC chart will be generated
EFILE="/opt/http/htdocs/darkgps/chartEFC0"
#
# This whee the Holdover Uncertainty chart will be generated
UFILE="/opt/http/htdocs/darkgps/chartHU0"
#
TITLE="darksmile.net Z3801A Receivers"
#
# This is the file that has the timelog data
LOG="/opt/gpsdata/timelogS0.log"
cd /opt/ntp/timelord/shm || exit
touch $FSEM
	./gpschart -i "${LOG}" -e "${EFILE}" -u "${UFILE}" -t "${TITLE}"
	echo ""
rm -f $FSEM
