not recognized $domain

Nova Web LTD

Verified User
Joined
Jan 23, 2014
Messages
41
Goodmorning everyone,
I'm building a custom script.
I do not understand why the ( $domain ) command is not recognized.
Basic example:
cp testfile.txt /etc/virtual/$domain/
Does not work
How can I solve?
thank you all
 
What's the name of the script you're trying to execute? (full path to it would be great)
 
He does not accept the command >>> $domain

echo "high_score=15" >> /etc/virtual/$domain/filter.conf
echo "high_score_block=yes" >> /etc/virtual/$domain/filter.conf
echo "where=userspamfolder" >> /etc/virtual/$domain/filter.conf
echo "rewrite_header subject *****SPAM*****" >> /home/$username/.spamassassin/user_prefs
 
You're not answering the question of what the name and full path of your script is. Linking to an article doesn't tell us anything, because you may or may not have followed it correctly.
 
Hello,

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".
 
Thanks for the answers,
I suppose we did not understand each other.
If I do the single script:

echo "high_score = 15" >> /etc/virtual/mydomain.com/filter.conf
ok it works

If I do this for all domains on the server:

echo "high_score = 15" >> /etc/virtual/$domain/filter.conf
does not work

I hope I was clear this way.
 
Call the script this way:


Code:
domain="[B]mydomain.com[/B]"; echo "high_score = 15" >> /etc/virtual/$domain/filter.conf


replace with your domain, and check my previous post if you need to run it for all domains.
 
Back
Top