3 [ -f ./setup-site.conf ] && source ./setup-site.conf
11 if [ -n "$1" -a -n "$2" ];
19 if [ -z "$topdir" -o -z "$site" -o \( "$#" -gt 0 \) ];
21 echo "Usage: setup-site [-v] [<topdir> <site>]" >&2
25 echo -e "Using\n\ttopdir=$topdir\n\tsite=$site"
27 find "$topdir" -maxdepth 4 -name '*.sed.in' | while read file;
29 wdir=$(dirname "$file")
30 newfile="$wdir/"$(basename "$file" .sed.in)
31 echo -e "processing\t$file"
32 [ -n "$verbose" ] && echo -e "->\t$newfile"
33 cp -p "$file" "$newfile"
34 sed -i -e "s#%SITE%#$site#g;s#%TOPDIR%#$topdir#g" "$newfile"
35 [ -n "$verbose" ] && diff -u "$file" "$newfile"