Current time: 06-14-2025, 12:42 PM Hello There, Guest! (LoginRegister)


Post Reply 
Automatic subdomain creation PLUS more...
Author Message
bulforce Offline
Junior Member
*

Posts: 63
Joined: Oct 2007
Reputation: 0
Post: #5
RE: Automatic subdomain creation PLUS more...
Thank you for your reply!

However i have little bit different approach. I am trying to do all those file manipulations within the ispcp-sub-mngr right after
Code:
opendir(DIR, "$sub_dir/htdocs/images/");
        my @files = readdir(DIR);
        closedir(DIR);

        foreach (@files) {
            # ignore . and .. :
            next if ($_ eq "." || $_ eq "..");
            $rs = setfmode("$sub_dir/htdocs/images/$_", $sys_user, $sys_group, 0644);
            return $rs if ($rs != 0);
        }

Thanks to ceco that help me to understand better how ispcp and perl are working i can now write things like:
Code:
$rs = sys_command("$main::cfg{'CMD_CP'} -rp $main::cfg{'GUI_ROOT_DIR'}/domain_default_page/cms-pakage/* $sub_dir/htdocs/");
return $rs if ($rs != 0);
## Files were copied
Which works perfectly fine, however... the following
Code:
$rs = sys_command("$main::cfg{'CMD_RM'} $sub_dir/htdocs/images $sub_dir/htdocs/index.html -RF");
return $rs if ($rs != 0);
or
Code:
$rs = sys_command("$main::cfg{'CMD_TAR'} -zxv $sub_dir/htdocs/cms-pakage.tgz");
return $rs if ($rs != 0);
Are resulting an errors and putting the subdomain in a "Unknown Error" Status

Quick look at the ispcp mysql database reveals this error messages:
Code:
sys_command() | ERROR: External command '/bin/rm /var/www/virtual/abc.com//123/htdocs/images /var/www/virtual/abc.com//123/htdocs/index.html -R' returned '1' status !
and
sys_command() | ERROR: External command '/bin/tar -zxv /var/www/virtual/abc.com//123/htdocs/cms-pakage.tgz' returned '2' status !


I believe that the problem is with the //, and i am wondering why $sub_dir translates to //123 instead of /123

Any ideas ?

Thank you
01-31-2009 09:06 AM
Find all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Automatic subdomain creation PLUS more... - bulforce - 01-31-2009 09:06 AM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)