batch functions

Equand

Verified User
Joined
Feb 27, 2006
Messages
38
is there a way to add domains in batch mode? using a simple \n separated list?
 
oh actually there is...
hope this helps someone, though it's not tested...
just specify
username,
password,
domain list(currently assigned to ./domains),
host,
and usual directives...
also u may specify a temporary cookie file...
Code:
#!/bin/sh
domains="./domains"
username=
password=
host=
bandwidth=1000
quota=0
ssl=ON
cgi=ON
php=ON
cookie="~/cookies"
curl --cookie-jar ${cookie} --data "username=${login}&password=${password}" http://${host}:2222/CMD_LOGIN > /dev/null
echo "Logged in..."
var=`cat ${domains}`
for domain in $var
do
        echo "Processing ${domain}"
        curl -O --cookie ${cookie} --data "action=create&domain=${domain}&bandwidth=${bandwidth}&quota=${quota}&ssl=${ssl}&cgi=${cgi}&php=${php}" http://${host}:2222/CMD_DOMAIN
done
rm CMD_DOMAIN ${cookie}
 
Back
Top