All pastes #280361 Raw Edit

Mine

public shellscript v1 · immutable
·published 2006-12-15 21:18 UTC
rendered paste body
#!/bin/shecho -ne "Content-type: text/html\r\n\r\n"echo "<HTML><TITLE>~X~ Logfiles</TITLE><BODY>"cd ~steam/steam/tfc/tfc/logs/echo "<TABLE border="1">"echo "<TR><TH>Logfile <TH>Map <TH>Size <TH>Start <TH>Length <TH>View stats <TH>Create stats"for logfile in $(find *.log -size +30k | sort -r)do	stats="$(stat $logfile)"	size=$(echo "$stats" | grep Size | awk '{print $2}')	dateTime=$(grep -m1 "^L" $logfile | awk '{print $2 " " $4}' | cut -c 0-19)	start=$(date -d "$dateTime" +"%d.%m.%y %T")	endDateTime=$(grep "^L" $logfile | tail -n1 | awk '{print $2 " " $4}' | cut -c 0-19)		secondsStart=$(date -d "$dateTime" +%s)	secondsEnd=$(date -d "$endDateTime" +%s)	timespanMinutes=$(echo "($secondsEnd-$secondsStart) / 60" | bc)	timespanSeconds=$(echo "($secondsEnd-$secondsStart) % 60" | bc)		if [ "$timespanSeconds" -lt 10 ]	then		timespanSeconds="0$timespanSeconds"	fi	map=$(grep -m1 "Started map" $logfile | awk '{print $7}' | cut -d \" -f2)	echo "<TR><TD><A href="getlog.cgi?log=$logfile">$logfile</A>"	echo "<TD>$map <TD align="right">$size <TD>$start <TD align="right">$timespanMinutes:$timespanSeconds"		if [ -d /var/www/logs/$logfile ]	then		echo "<TD> <A href="/logs/$logfile">view</A>"	else		echo "<TD>"	fi	echo "<TD> <A href="/cgi-bin/logs/admin/createlog.cgi?log=$logfile">create</A>"doneecho "</TABLE>"echo "</BODY></HTML>"