#!/bin/sh

. `dirname $0`/sub.defaults

if [ $# -ne 4 ]; then
   echo $0: TLD SLD SUBDOMAIN VUSER
   exit 1
fi

TLD="$1"
SLD="$2"
SUBDOMAIN="$3"
VUSER="$4"

echo -n add: webalizer $SUBDOMAIN.$SLD.$TLD from $WEBALIZER_DEFAULT for $VUSER...

cat "$WEBALIZER_DEFAULT" | sed -e "s/__TLD/$TLD/g" \
                               -e  "s/__SLD/$SLD/g" \
                               -e  "s/__VUSER/$VUSER/g" \
                               -e "s/__SUBDOMAIN/$SUBDOMAIN/g" > \
                    $WEBBASE/$VUSER/$TLD/$SLD/$SUBDOMAIN/logs/webalizer/webalizer.conf

echo done.