Easy Scripts

Is there a way to insert the site name into a easy script??

greetings JTH

please explain abit your request..
insert site name to where ?
will site name a constant, in db, or will be prompted by user ?

I want to make a script that makes a symlink to a specified direction whit in the name of the symlink the domain name of the site. Thats short what i want to do.

greetings JTH

i think you can do that,
go to your phpmyadmin,
ehcp db
scripts table
edit your custom script name,
edit field commandsaftercopy,
you may put any linux command in that field, like ln -s, or link commands..

The only thing, to insert domainname at some point of commands, you need a patch in ehcp code,
i will prepare and send you a patch for related function in a few minutes...

open classapp.php with your favorite editor,

find function:
function getAndInstallFile($bilgi,$domain,$directory){

then find line that says (near bottom of function):
foreach(explode("\n",$bilgi['commandsaftercopy']) as $com) {

then add following just below that line:

save the file,
restart ehcp: /etc/init.d/ehcp restart

After that, you may use the tags {domainname}, {domainhome} and {targetdirectory} in "commandsaftercopy" section/field of scripts table.

thats all..

for ex:
if you have domain: yourdom.com
you installed the script (of your desire) into dir: mydir
then, those variables are equivalent to:
{domainname} -> yourdom.com
{domainhome} -> /var/www/yourftp/yourdom.com/httpdocs
{targetdirectory} -> /var/www/yourftp/yourdom.com/httpdocs/mydir

note that, target directory includes domainname too..

for ex:
if you wish to make the script to symlink to a place of your domain:
ln -s {domainhome} /your/other/place

Note that easy install scripts will download and install existing scripts/programs such as phpbb to in your domain directories.. if you just want to execute some commands, but do not want actually to insall anything, then you may setup an empty/dummy zip and show it as a script to this feature..

(this patch will be included in newer versions of ehcp)