Skip to content

Commit eda54dd

Browse files
committed
bugfix to handle bad data in login details
1 parent a439fe1 commit eda54dd

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

archive/website/cameraStatusReport.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ else
3636
authlog=/var/log/secure
3737
batchuser=ec2-user
3838
fi
39-
sudo grep publickey $authlog* | grep -v $batchuser > $DATADIR/reports/lastlogins.txt
39+
sudo grep publickey $authlog* | grep -v $batchuser | grep -v fatal > $DATADIR/reports/lastlogins.txt
4040

4141
if [ "$platform" == "Ubuntu" ]
4242
then
43-
ssh ukmonhelper2 "sudo grep publickey /var/log/secure* | grep -v ec2-user" > $DATADIR/reports/lastlogins_old.txt
43+
ssh ukmonhelper2 "sudo grep publickey /var/log/secure* | egrep -v 'ec2-user|fatal'" > $DATADIR/reports/lastlogins_old.txt
4444
fi
4545
cat $DATADIR/reports/lastlogins_old.txt >> $DATADIR/reports/lastlogins.txt
4646
echo TO HERE

0 commit comments

Comments
 (0)