🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.privacy.anon-server
Article #299962

allpingers.txt check script

#299962
From: Fritz Wuehler
Date: Fri, 14 Sep 2018 03:51
38 lines
2724 bytes
  On a couple occasions, I have found that the update to the allpingers.txt didn't work.  The allpingers.txt file contained one or two lines, something about an 'error'.  This script will check the allpingers.txt file via cron, 2 minutes after it is supposedly updated.  If there are not more than 10 lines in the file, it will send you an error email.

#!/bin/bash
#
# This script checks the allpingers.txt file to see if it has
# data therein.  mixloc should point to the folder that contains
# the allpingers.txt file, usually the same place where mixmaster
# is located.

filePath=${0%/*}
mixloc="/var/mixmaster"           # loc of allpingers.txt in new mixmaster 3.1
emailaddr="your@email.address"    # replace this with your contact email address

if [ ! -e $filePath/AllpingersChkData.txt ]; then            # see if error toggle file exist
   cat /dev/null > $filePath/AllpingersChkData.txt
fi

if [[ $(cat $mixloc/allpingers.txt | wc -l) -gt 10 ]]; then  # check if allpingers.txt has more than 10 records
   cat /dev/null > $filePath/AllpingersChkData.txt           # reset error toggle file
   exit 0
fi

if [[ $(cat $mixloc/allpingers.txt | wc -l) -lt 10 ]] && /
   [[ $(grep -c "ERROR" $filePath/AllpingersChkData.txt) -eq 0 ]]; then  # has error email already been sent?
   echo "ERROR" > $filePath/AllpingersChkData.txt
   mutt -s "$mixloc/allpingers.txt empty!" $emailaddr < $mixloc/allpingers.txt
fi

exit 0  # end of script



Cron example:

00 6,11,18 * * * /etc/cron.daily/mixmaster  # your current update mixmaster stats cron

# cron - set a cron to execute like your stats update cron, only set it to execute 2 minutes after
02 6,11,18 * * * /<path to>/allpingers.sh  # check to see if allpingers.txt has data
Technical Details
Message-ID: <8ef395802aecda005377703b7480f359@msgid.frell.theremailer.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!news.usenet.farm!..!..!not-for-mail

Show Full Headers
Complete Article Headers
Message-ID: <8ef395802aecda005377703b7480f359@msgid.frell.theremailer.net>
Subject: allpingers.txt check script
Date: Fri, 14 Sep 2018 03:51:58 +0000
From: Fritz Wuehler <fritz@spamexpire-201809.rodent.frell.theremailer.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!apf1.newsdeef.eu!news.usenet.farm!..!..!not-for-mail
Comments: This message did not originate from the Sender address above.
 It was remailed automatically by anonymizing remailer software.
 Please report problems or inappropriate use to the
 remailer administrator at <abuse@frell.theremailer.net>.
 Identifying the real sender is technically impossible.
Precedence: anon
Newsgroups: alt.privacy.anon-server
Injection-Info: mail2news.mixmin.net; posting-host=mail2news.mixmin.net;
 mail-complaints-to=abuse@mixmin.net
Lines: 38