Nice!

Based on ensim although has been been customised for DirectAdmin

basically variables are:

$username - Username
$domain - Domain name

# mkdir urchin-automation
# cd urchin-automation
# pico -w urchin-add.sh

add the following:

Code:
#!/bin/sh

URCHINPATH="/usr/local/urchin"
OUTPUT="/tmp/urchin-temp.conf"

DOMAIN=$domain
USER=$username@$domain
PASSWORD="default_password"

echo "<Profile Name="$DOMAIN">" > $OUTPUT
echo " ct_name=$DOMAIN" >> $OUTPUT
echo " ct_affiliation=(NONE)" >> $OUTPUT
echo " ct_website=http://www.$DOMAIN" >> $OUTPUT
echo " ct_reportdomains=www.$DOMAIN,$DOMAIN" >> $OUTPUT
echo " cs_llist=$DOMAIN-access-log,$DOMAIN-access-log.[1-4]" >> $OUTPUT
echo " ct_defaultpage=index.html" >> $OUTPUT
echo " cs_vmethod=0" >> $OUTPUT
echo " cs_ulist=$USER" >> $OUTPUT
echo "</Profile>" >> $OUTPUT
echo >> $OUTPUT
echo "<Task Name="$DOMAIN">" >> $OUTPUT
echo " ct_name=$DOMAIN" >> $OUTPUT
echo " ct_affiliation=(NONE)" >> $OUTPUT
echo " cr_frequency=4" >> $OUTPUT
echo " cr_minute=0" >> $OUTPUT
echo " cr_runnow=0" >> $OUTPUT
echo " cr_enabled=off" >> $OUTPUT
echo "</Task>" >> $OUTPUT
echo >> $OUTPUT
echo "<Logfile Name="$DOMAIN-access-log">" >> $OUTPUT
echo " ct_name=$DOMAIN-access-log" >> $OUTPUT
echo " ct_affiliation=(NONE)" >> $OUTPUT
echo " ct_loglocation=[B]/path/to/access_log[/B]" >> $OUTPUT
echo " cs_logformat=ncsa" >> $OUTPUT
echo " cr_type=local" >> $OUTPUT
echo " cs_rlist=$DOMAIN" >> $OUTPUT
echo "</Logfile>" >> $OUTPUT
echo >> $OUTPUT
echo "<Logfile Name="$DOMAIN-access-log.[1-4]">" >> $OUTPUT
echo " ct_name=$DOMAIN-access-log.[1-4]" >> $OUTPUT
echo " ct_affiliation=(NONE)" >> $OUTPUT
echo " ct_loglocation=[B]/path/to/access_log[/B].[1-4]">> $OUTPUT
echo " cs_logformat=ncsa" >> $OUTPUT
echo " cr_type=local" >> $OUTPUT
echo " cs_rlist=$DOMAIN" >> $OUTPUT
echo "</Logfile>" >> $OUTPUT
echo >> $OUTPUT
echo "<User Name="$USER">" >> $OUTPUT
echo " ct_affiliation=(NONE)" >> $OUTPUT
echo " ct_fullname="$DOMAIN"" >> $OUTPUT
echo " ct_name=$USER" >> $OUTPUT
echo " ct_password=$PASSWORD" >> $OUTPUT
echo " cs_rlist=$DOMAIN" >> $OUTPUT
echo "</User>" >> $OUTPUT

$URCHINPATH/util/uconf-import -f $OUTPUT

Set permissions

Code:
chmod 755 urchin-add.sh

Using DirectAdmin you then run:

Code:
/urchin-automation/urchin-add.sh

I would suggest using user_create_post.sh for this

The paths in bold need to be customised appropriately apart from that i think its pretty much done, feel free to play around with it test it whatever you want, and finally thanks to foggy over @ ev1 forums for creating a new thread with that how-to since the original site closed down i believe!

Please note also that i take no responsibility with the use of this :)

Chris
 
Here are the paths to logs

Live:
echo " ct_loglocation=/var/log/httpd/domains/$domain.log" >> $OUTPUT


Archives:
echo " ct_loglocation=/home/$username/domains/$domain/logs/access_log.[1-4]">> $OUTPUT


I don't habe archives yet on that server, so if the filename is not access_log, please tell me and I'll update this post.
 
Last edited:
Back
Top