I'm building a custom script.
I do not understand why the ( $domain ) command is not recognized.
cp testfile.txt /etc/virtual/$domain/
Does not work
How can I solve?
thank you all
Variables in the script /usr/local/directadmin/scripts/custom/domain_create_post.sh mentioned in the article can be "recognized" only when the script is executed by Directadmin.
To make it work when executing the script manually in a shell you need first define the missing variables. So you need to run it per user/domain or use a loop. You can find an example here https://help.directadmin.com/item.php?id=319 Start reading after words "If you wish to apply this to existing domains, you can create the script".