Linux-Noob Forums

Full Version: how to rotate your favicon.ico and logo in IPB hourly
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

for the favicon.ico use this

 

stick it in /etc/cron.hourly/changeico.sh

 



Code:
#!/bin/sh

SOURCEDIR="/usr/local/apache/htdocs/favicon/"
TARGETFILE="/usr/local/apache/htdocs/forums/favicon.ico"

NUM=`ls -1 $SOURCEDIR|wc -l`
cp -f $SOURCEDIR`ls -1 $SOURCEDIR|head -n $[$RANDOM%$NUM+1]|tail -n1` $TARGETFILE




 

for the IPB logo (which youve changed to your own ! - i use 8 different ones)

 

try this

 

stick it in /etc/cron.hourly/changelogo.sh

 



Code:
#!/bin/sh

SOURCEDIR="/usr/local/apache/htdocs/logos/"
TARGETFILE="/usr/local/apache/htdocs/forums/style_images/1/logo4.gif"

NUM=`ls -1 $SOURCEDIR|wc -l`
cp -f $SOURCEDIR`ls -1 $SOURCEDIR|head -n $[$RANDOM%$NUM+1]|tail -n1` $TARGETFILE




 

both files above need to executable

 

do

 



Code:
chmod +x changelogo.sh




 

etc...

 

cheers

anyweb