Thread View: alt.privacy.anon-server
3 messages
3 total messages
Started by Fritz Wuehler
Fri, 14 Sep 2018 03:51
allpingers.txt check script
Author: Fritz Wuehler
Date: Fri, 14 Sep 2018 03:51
Date: Fri, 14 Sep 2018 03:51
38 lines
2724 bytes
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
Re: allpingers.txt check script
Author: elvis-85650
Date: Fri, 14 Sep 2018 09:30
Date: Fri, 14 Sep 2018 09:30
25 lines
2099 bytes
2099 bytes
1 > #!/bin/bash
2 > #
3 > # This script checks the allpingers.txt file to see if it has
4 > # data therein. mixloc should point to the folder that contains
5 > # the allpingers.txt file, usually the same place where mixmaster
6 > # is located.
7 >
8 > filePath=${0%/*}
Only used in relation to AllpingersChkData.txt - could have set whole filename in one step.
13 > cat /dev/null > $filePath/AllpingersChkData.txt
same thing by "> $filePath/AllpingersChkData.txt"
16 > if [[ $(cat $mixloc/allpingers.txt | wc -l) -gt 10 ]]; then # check if allpingers.txt has more than 10 records
[[ $(wc -l < $mixloc/allpingers.txt) -gt 10 ]]
21 > if [[ $(cat $mixloc/allpingers.txt | wc -l) -lt 10 ]] && /
test almost repeated from line 16 although you would have exited if -gt 10 and it didn't save the coount
22 > [[ $(grep -c "ERROR" $filePath/AllpingersChkData.txt) -eq 0 ]]; then # has error email already been sent?
No quotes needed on ERROR.
24 > mutt -s "$mixloc/allpingers.txt empty!" $emailaddr < $mixloc/allpingers.txt
Is mutt safe with unknown input? See "kind Mr. Icarus Sparry" in:
https://www.usenix.org/legacy/publications/library/proceedings/sec96/full_papers/venema/venema.txt
Re: allpingers.txt check script
Author: Anonymous Remailer (austria)
Date: Fri, 14 Sep 2018 13:43
Date: Fri, 14 Sep 2018 13:43
10 lines
1106 bytes
1106 bytes
Changed the mutt to mail https://paste.debian.net/1042176 > 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
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads