blob: f3a76563bd17667a3b1cdc2112deab99d348f59f (
plain)
1
2
3
4
5
6
7
8
9
10
|
#!/bin/sh -e
logfile='/var/log/nginx/access.log'
destfile='/usr/local/www/jozan/index.html'
foretext='Unique visitors: '
tmp=$(mktemp)
sed "s/$foretext.*$/$foretext$(awk '{print $1}' $logfile | sort | uniq | wc -l | tr -d ' ')/" $destfile >"$tmp"
cat "$tmp" >$destfile
rm "$tmp"
|