Customizing /usr/local/directadmin/data/templates/custom/virtual_host2_secure.conf

sparek

Verified User
Joined
Jun 27, 2019
Messages
544
I'm wanting to do an "if file exists then..." segment in the the /usr/local/directadmin/data/templates/custom/virtual_host2_secure.conf and related files.

I know there's a way to pipe scripting through a bash or PHP script in here, but I cannot for the life of me find that documentation. I saw it at one time, I know it's there.

Or is there a native way to do an "if file exists... else..." within these templates?
 
Hello,

A good number of our templates support full shell/shebang type scripting.
You can do some crazy things, like full back-end database queries, php, or even basic /bin/sh if you want to do that:
https://www.directadmin.com/features.php?id=756

Anything you echo will end up in the template.

So for a simple if-exists then, you'd do something like
Code:
|$/bin/sh
if [ -e /your/file/in/question.txt ];
	cat /your/file/in/question.txt
fi
exit 0;
DONE|

John
 
Yea, I finally found it, but I actually went in a different direction with this.

But yea, that documentation was what I was looking for. I thought I'd put this in my notes, but I guess I did not. I found another forum post that gave me some hints.

Thanks
 
Back
Top