diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2022-04-21 22:17:18 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2022-04-21 22:17:18 +0200 |
commit | 5fbd3e4a4156a2c61d7f6e9a953c8dd0f4b1b341 (patch) | |
tree | 5d8939be915360430269838dd24d0fba696da966 /src/cron/counter.sh | |
parent | Smoother like this, changed url (diff) | |
download | joe-scripts-5fbd3e4a4156a2c61d7f6e9a953c8dd0f4b1b341.tar.gz joe-scripts-5fbd3e4a4156a2c61d7f6e9a953c8dd0f4b1b341.tar.bz2 joe-scripts-5fbd3e4a4156a2c61d7f6e9a953c8dd0f4b1b341.tar.xz joe-scripts-5fbd3e4a4156a2c61d7f6e9a953c8dd0f4b1b341.tar.zst joe-scripts-5fbd3e4a4156a2c61d7f6e9a953c8dd0f4b1b341.zip |
counter update, less retarded and probably opti
Diffstat (limited to '')
-rwxr-xr-x | src/cron/counter.sh | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/cron/counter.sh b/src/cron/counter.sh index f9fc80a..fdc5f18 100755 --- a/src/cron/counter.sh +++ b/src/cron/counter.sh @@ -3,10 +3,7 @@ logfile='/var/log/nginx/access.log' destfile='/usr/local/www/jozan/index.html' foretext='Unique visitors: ' -tmp=$(mktemp) [ -e $logfile ] || exit 1 [ -e $destfile ] || exit 1 -sed "s/$foretext.*$/$foretext<b>$(awk '{print $1}' $logfile | sort | uniq | wc -l | tr -d ' ')<\/b>/" $destfile >"$tmp" || rm "$tmp" -cat "$tmp" >$destfile -rm "$tmp" +sed -i '' "s/$foretext.*$/$foretext<b>$(awk '{print $1}' $logfile | sort | uniq | wc -l | tr -d ' ')<\/b>/" $destfile |