#!/bin/sh ########################################################################## # I hardcoded the directory to use into my scripts. In order to help # you to adjust the scripts to your needs I provide this little # script, that changes all directory-definitions in the scripts to # a directory specified in NEWROOT. Set this variable to your httpd-home. ########################################################################## OLDROOT="/usr/local/etc/httpd" NEWROOT="/home/mha/public_html/server" # escape all slashes ("/" --> "\/") E_OLDROOT=`echo $OLDROOT|awk 'BEGIN{FS="/";OFS="";ORS=""}{for (t=2;t<=NF;t++) {print "\/",$t}}'` E_NEWROOT=`echo $NEWROOT|awk 'BEGIN{FS="/";OFS="";ORS=""}{for (t=2;t<=NF;t++) {print "\/",$t}}'` for t in $NEWROOT/fax-*; do cd $t for i in *; do cat $i | sed -e "s/$E_OLDROOT/$E_NEWROOT/" > $i.tmp echo ##################################################### echo "FILE: $i\ndiff-output:" diff $i $i.tmp echo ##################################################### mv $i.tmp $i chown httpd * chgrp httpd * chmod 770 * done done # you can also use this script for changing other info, # just set E_[OLD|NEW]ROOT accordingly # (e.g. you might want to rename the cgi-paths or the like): # E_OLDROOT="fax-usr" # E_NEWROOT="something_you_like" # insert these two lines just above the first for-statement # and don't forget that NEWROOT must contain the right path # (or change it in the first for-statement)