Advertisement
tjone270

SearchLogs.sh

Oct 3rd, 2015
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.47 KB | None | 0 0
  1. #! /bin/bash
  2. # searchlogs.sh - quake live dedicated server log view utility.
  3. # created by Thomas Jones on 02/10/15.
  4. # purger@tomtecsolutions.com
  5.  
  6. if [ $# -eq 0 ]; then
  7.     echo "Usage:"
  8.     echo "    ./searchlogs.sh <string> <server id> <surrounding lines>"
  9.     echo ""
  10.     echo "Example:"
  11.     echo "    ./searchlogs.sh 'purger' 0 3"
  12.     exit 1
  13. fi
  14.  
  15. echo "Searching for '$1' on server \#$2..."
  16. sudo grep -niC $3 "$1" /tmp/qzeroded_$2* | more -d
  17. echo Done.
  18. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement