6 if [ -z "$topdir" -o -z "$site" ];
8 echo "Usage: setup-site <topdir> <site>" >&2
12 echo -e "Using\n\ttopdir=$topdir\n\tsite=$site"
14 find "$topdir" -maxdepth 2 -name '*.sed.in' | while read file;
16 wdir=$(dirname "$file")
17 newfile="$wdir/"$(basename "$file" .sed.in)
18 echo -e "processing\n\t$file\n->\t$newfile"
19 cp -p "$file" "$newfile"
20 sed -i -e "s#%SITE%#$site#g;s#%TOPDIR%#$topdir#g" "$newfile"
21 diff -u "$file" "$newfile"