#! /bin/bash #Copyright 1998-2022 Stonie R. Cooper, Licensed under the auspices of GPLv3, # See top-level copyright disclaimer (COPYRIGHT) and license (LICENSE) HOST=`hostname` cd /var/www/localhost/htdocs/ CHANNELS=`/usr/bin/MakeGraphs | awk -F: '{print $2}'` NOOFCHNL=`echo ${CHANNELS} | wc -w | awk -F" " '{print $1}'` CHANLARR=(`echo ${CHANNELS}`) printf "\n" > index.html printf "\n" >> index.html printf "\nNOAAPort Statistics\n\n\n" >> index.html printf "\n" >> index.html DATESTRING=`date -u "+%Y%m%d %H:%M:%SGMT"` printf "
\n\n

\n%s NOAAPort Statistics at %s
\n

\n
\n
\n" "${HOST}" "${DATESTRING}" >> index.html printf "
\n" >> index.html printf "\n" >> index.html printf "\n" >> index.html printf "\n" >> index.html printf "\n" >> index.html printf "
\n" >> index.html printf "\n" >> index.html for eachLine in `/usr/bin/pdinrs -w | sed -e "s/ / \ /g" | tr ' ' '^'` do printf "%s
\n" "`echo ${eachLine} | tr '^' ' '`" >> index.html done printf "
\n" >> index.html printf "
\n" >> index.html count=0 printf "\n" >> index.html printf "\n" >> index.html RESET=0 while [ ${count} -lt ${NOOFCHNL} ] do LOSS=`pdinrs -w | grep " ${CHANLARR[${count}]} " | grep -v " ${CHANLARR[${count}]} Queue " | awk -F" " '{print $4}' | awk -F. '{print $1}'` if [ "${LOSS}" = "nan" ]; then LOSS=0 fi if [ ${LOSS} -lt 0 -o ${LOSS} -gt 10 ]; then RESET=1 fi printf "\n" >> index.html printf "\n" > ${CHANLARR[${count}]}.html printf "\n" >> ${CHANLARR[${count}]}.html printf "\n${CHANLARR[${count}]} Statistics\n\n\n" >> ${CHANLARR[${count}]}.html printf "\n" >> ${CHANLARR[${count}]}.html DATESTRING=`date -u "+%Y%m%d %H:%M:%SGMT"` printf "
\n\n

\n${CHANLARR[${count}]} Statistics at %s
\n

\n
\n
\n" "${DATESTRING}" >> ${CHANLARR[${count}]}.html printf "
\n" >> ${CHANLARR[${count}]}.html printf "
\n" >> index.html printf "

${CHANLARR[${count}]}

\n" >> index.html printf "\n" >> index.html printf "
\n" >> ${CHANLARR[${count}]}.html printf "\n" >> ${CHANLARR[${count}]}.html printf "\n" >> ${CHANLARR[${count}]}.html printf "\n" >> ${CHANLARR[${count}]}.html printf "\n" >> ${CHANLARR[${count}]}.html printf "\n" >> ${CHANLARR[${count}]}.html printf "\n" >> ${CHANLARR[${count}]}.html printf "\n" >> ${CHANLARR[${count}]}.html printf "
\n
\nSince Reset
\n
\n
\n
\nLast 24 Hours
\n
\n
\n
\nLast 12 Hours
\n
\n
\n
\nLast 6 Hours
\n
\n
\n
\nLast Hour
\n
\n
\n" >> ${CHANLARR[${count}]}.html printf "
\n" >> ${CHANLARR[${count}]}.html printf "\n" >> ${CHANLARR[${count}]}.html printf "\n" >> ${CHANLARR[${count}]}.html count=`expr ${count} + 1` done if [ ${RESET} -ne 0 ]; then pdinrs -m > /dev/null 2>&1 fi printf "\n" >> index.html printf "\n" >> index.html printf "\n" >> index.html printf "\n" >> index.html printf "\n" >> index.html