initial public commit
[logtools.git] / countconn
1 #!/bin/sh
2
3 SERVER=$(which > /dev/null apache2 && printf "apache2" || which > /dev/null nginx && printf "nginx" || printf "ERROR: server not detected, needs to be set manually")
4
5 [ "$1" -eq "$1" ] 2>/dev/null && NUM="$1" || NUM=30
6
7 cut -d: -f2,3 < /var/log/"$SERVER"/access.log | uniq -c | tail -n"$NUM"