From c0e4c95cfb1e5c6f389ebe798fa122bf889687c6 Mon Sep 17 00:00:00 2001 From: Matt Baer Date: Thu, 25 Jan 2018 17:30:41 -0500 Subject: [PATCH] Prevent findBots.sh running when no arg given --- bots/findBots.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bots/findBots.sh b/bots/findBots.sh index e0319b6..f27e610 100755 --- a/bots/findBots.sh +++ b/bots/findBots.sh @@ -7,6 +7,11 @@ # usage: findBots.sh application.log # +if [ -z $1 ]; then + echo usage: findBots.sh [logfilename] + exit 1 +fi + cat /var/log/$1 | grep -i 'bot\|spider\|crawl\|scraper\|indexer\|voltron' | awk -F\" '{print $4}' | sort | uniq > bots.txt rm bots.go