We are happy to announce that Vesta is back under active development as of 25 February 2024. We are working on v1 candidate and expect to engage more with the community over the coming months. We are committed to open source, and we encourage contributors to help us build the future of Vesta.
How to bulk add domains to vestaCP?
How to bulk add domains to vestaCP?
Hi everyone :)
That's my first topic and I'm starting my journey with VestaCP :).
I need to add in bulk:
- about 20 databases (every diffrent password and name)
- about 20 domains but every domin need to have added:
a) two different A records
b) two changes in "12 lists records" (localhost to the name of domain.
What can you recommend for me?
Regards,
W
That's my first topic and I'm starting my journey with VestaCP :).
I need to add in bulk:
- about 20 databases (every diffrent password and name)
- about 20 domains but every domin need to have added:
a) two different A records
b) two changes in "12 lists records" (localhost to the name of domain.
What can you recommend for me?
Regards,
W
Re: How to bulk add domains to vestaCP?
bash script
commands:
v-add-domain
commands:
v-add-domain
v-add-databaseUsage: v-add-domain USER DOMAIN [IP] [RESTART]
Usage: v-add-database USER DATABASE DBUSER DBPASS [TYPE] [HOST] [CHARSET]
-
- Posts: 31
- Joined: Wed Jul 13, 2016 1:35 pm
Re: How to bulk add domains to vestaCP?
This is script to bulk add email account.
You can rewrite him to use for buld add domains and databases
You can rewrite him to use for buld add domains and databases
Code: Select all
#!/bin/bash
username='john'
emails="$(cat emails)"
outfile='passwd'
if [ -a $outfile ]; then
rm -f $outfile
fi
for email in $emails;
do
account="$(echo $email | awk --field-separator='@' '{print $1}')"
domain="$(echo $email | awk --field-separator='@' '{print $2}')"
password="$(< /dev/urandom tr -dc _A-Z-a-z-0-9 | head -c${1:-12};echo;)"
#Usage: v-add-mail-account USER DOMAIN ACCOUNT PASSWORD [QUOTA]
/usr/local/vesta/bin/v-add-mail-account $username $domain $account $password 1000
echo $email $password >> $outfile
done