#!/bin/sh echo -ne "Content-type: text/html\r\n\r\n" echo "
" cd ~steam/steam/tfc/tfc/logs/ echo "| Logfile | Map | Size | Start | Length | View stats | Create stats" for logfile in $(find *.log -size +20k | sort -r) do stats="$(stat $logfile)" size=$(echo "$stats" | grep Size | awk '{print $2}') #date=$(echo "$stats" | grep Access | awk '{print $2 }') #time=$(echo "$stats" | grep Access | awk '{print $3 }') date=$(cat $logfile | grep "^L" | head -n1 | awk '{print $2}') time=$(cat $logfile | grep "^L" | head -n1 | awk '{print $4}' | cut -c 0-8) start=$(date -d "$date $time" +"%d.%m.%y %T") enddate=$(cat $logfile | grep "^L" | tail -n1 | awk '{print $2}') endtime=$(cat $logfile | grep "^L" | tail -n1 | awk '{print $4}' | cut -c 0-8) secondsStart=$(date -d "$date $time" +%s) secondsEnd=$(date -d "$date $endtime" +%s) timespan=$(echo $secondsEnd-$secondsStart | bc) timespanMinutes=$(echo "$timespan / 60" | bc) timespanSeconds=$(echo "$timespan % 60" | bc) if [ "$(echo "length($timespanSeconds)" | bc)" = "1" ] then timespanSeconds="0$timespanSeconds" fi map=$(grep -m1 "Started map" $logfile | awk '{print $7}' | cut -d \" -f2) echo " | |
|---|---|---|---|---|---|---|---|
| $logfile" echo " | $map | $size | $start | $timespanMinutes:$timespanSeconds" if [ -d /var/www/logs/$logfile ] then echo " | view" else echo " | " fi echo " | create" done echo " |