#!/bin/bash # # Copyright (C) 2008 LAFKON / Christoph Haag # # This is free software, and you may redistribute it under the GPL. # This Software comes with absolutely no warranty. # For details see the license (http://www.lafkon.net/gpl.txt) COUNT=0 FOLDER=640px ACCESSFILE=$FOLDER/.forkaccess URL= echo RewriteEngine on > $ACCESSFILE echo RewriteRule ^random.jpg\$ %\{TIME_SEC\}.jpg >> $ACCESSFILE echo >> $ACCESSFILE while [ $COUNT -le 60 ] do FILE=`ls $FOLDER/*.jpg | rl --count=1` SEC=`echo 0$COUNT | rev | cut -c 1-2 | rev` echo RewriteRule \^$SEC.jpg\$ $URL${FILE##*/} >> $ACCESSFILE COUNT=`expr $COUNT + 1` done exit 0;