mirror of
https://github.com/paradizelost/Linux-Scripts.git
synced 2024-11-25 02:44:44 -06:00
Cleanup
Moved where variables were initialized and fixed that vtext numbers don't need the 1 or else they don't work.
This commit is contained in:
parent
4c6efb2896
commit
1c7a32aceb
19
logwatch.sh
19
logwatch.sh
@ -1,4 +1,13 @@
|
||||
#!/bin/bash
|
||||
LOG="/var/log/logs/192.168.1.113.log"
|
||||
LOG2="/var/log/logs/192.168.1.104.log"
|
||||
LOG3="/var/log/logs/192.168.1.252-1.log"
|
||||
EVT="$(comm --nocheck-order -23 "$LOG" "$LOG.old" | wc -l)"
|
||||
EVT2="$(comm --nocheck-order -23 "$LOG2" "$LOG2.old" | wc -l)"
|
||||
EVT3="$(comm --nocheck-order -23 "$LOG3" "$LOG3.old" | wc -l)"
|
||||
PHONE1="5555555555@vtext.com"
|
||||
PHONE2="5555555555@vtext.com"
|
||||
PHONE3="5555555555@vtext.com"
|
||||
function procaplog(){
|
||||
while IFS=, read -r date mac; do
|
||||
HOSTNAME=$(checkmac "$mac")
|
||||
@ -46,15 +55,7 @@ function alert_dan(){
|
||||
nail -s "$1" -S from="Alerts@hamik.net" "$PHONE1" <<<"."
|
||||
nail -s "$1" -S from="Alerts@hamik.net" "$PHONE3" <<<"."
|
||||
};
|
||||
LOG="/var/log/logs/192.168.1.113.log"
|
||||
LOG2="/var/log/logs/192.168.1.104.log"
|
||||
LOG3="/var/log/logs/192.168.1.252-1.log"
|
||||
EVT="$(comm --nocheck-order -23 "$LOG" "$LOG.old" | wc -l)"
|
||||
EVT2="$(comm --nocheck-order -23 "$LOG2" "$LOG2.old" | wc -l)"
|
||||
EVT3="$(comm --nocheck-order -23 "$LOG3" "$LOG3.old" | wc -l)"
|
||||
PHONE1="15555555555@vtext.com"
|
||||
PHONE2="15555555555@vtext.com"
|
||||
PHONE3="15555555555@vtext.com"
|
||||
|
||||
|
||||
if [ "$EVT" != "0" ]; then
|
||||
cp "$LOG" "$LOG.old"
|
||||
|
Loading…
Reference in New Issue
Block a user