Page 1 of 1

(Solved) bash script to create Web/Ftp/DB

Posted: Sun Jul 10, 2016 7:55 am
by mehargags
Hi all,
@imperio @skurudo & other members... can you please help.

I'm writing a small script using VESTACP CLI but facing a bit of a problem. Here is the script

Code: Select all

#!/bin/bash
$domn='abc.com'
VESTA='/usr/local/vesta/bin'
#       Adding default domain
$VESTA/v-add-domain $domn
when I run the script it throws the following errors and DOESN'T CREATE any Web-domain

Code: Select all

/usr/local/vesta/bin/v-add-domain: line 19: /usr/local/vesta/bin/func/main.sh: No such file or directory
/usr/local/vesta/bin/v-add-domain: line 20: /usr/local/vesta/bin/func/ip.sh: No such file or directory
/usr/local/vesta/bin/v-add-domain: line 21: /usr/local/vesta/bin/conf/vesta.conf: No such file or directory
/usr/local/vesta/bin/v-add-domain: line 27: check_args: command not found
/usr/local/vesta/bin/v-add-domain: line 28: is_format_valid: command not found
/usr/local/vesta/bin/v-add-domain: line 32: is_object_valid: command not found
/usr/local/vesta/bin/v-add-domain: line 33: is_object_unsuspended: command not found
/usr/local/vesta/bin/v-add-domain: line 42: get_user_ip: command not found
/usr/local/vesta/bin/v-add-domain: line 44: check_result: command not found
/usr/local/vesta/bin/v-add-domain: line 68: /v-restart-web: No such file or directory
/usr/local/vesta/bin/v-add-domain: line 69: check_result: command not found
/usr/local/vesta/bin/v-add-domain: line 74: /v-restart-dns: No such file or directory
/usr/local/vesta/bin/v-add-domain: line 75: check_result: command not found
Using the VestaCP CLI directly does work, however I do get a warning message:

Code: Select all

v-add-domain admin abc.com 
chown: invalid user: 'dovecot:mail'
[/i][/b]

Any pointers how to fix this ?

Re: bash script to create Web/Ftp/DB

Posted: Sun Jul 10, 2016 8:25 am
by mehargags
Resolved...
I was reusing the Environment variable $VESTA and declaring it again. Removed that line and it works now

Now the only problem now remains is when I create domain, it throws

Code: Select all

chown: invalid user: 'dovecot:mail'