ispman/bin ispman.add_vhost,NONE,1.1 ispman.make_vhosts_conf,NONE,1.1 ispman.modify_vhost,NONE,1.1 ispman.executeTask,1.1,1.2

Atif Ghaffar <[email protected]>
Newsgroups gmane.comp.isp.ispman.cvs
Message-ID <[email protected]>
Update of /cvsroot/ispman/ispman/bin
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18397

Modified Files:
	ispman.executeTask 
Added Files:
	ispman.add_vhost ispman.make_vhosts_conf ispman.modify_vhost 
Log Message:
Added some more utility files

--- NEW FILE: ispman.add_vhost ---
#!/usr/bin/perl
package ISPMan;

BEGIN {
    use FindBin;
    unshift @INC,
      ( $FindBin::Bin, "$FindBin::Bin/../lib", "$FindBin::Bin/../conf" );
}

use ISPMan;
$ispman = ISPMan->new();
require "$FindBin::Bin/../lib/http.lib";
# defind log_message.
# This is defined in ispman-agent and we should redefine here
sub logsay {
    my $message = join ' ', @_;
    chomp($message);
    print "$message\n";
}


&add_vhost(@ARGV);


__END__



Index: ispman.executeTask
===================================================================
RCS file: /cvsroot/ispman/ispman/bin/ispman.executeTask,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- ispman.executeTask	29 Dec 2004 23:34:27 -0000	1.1
+++ ispman.executeTask	30 Dec 2004 04:34:57 -0000	1.2
@@ -3,9 +3,10 @@
     use FindBin;
     unshift @INC,( $FindBin::Bin, "$FindBin::Bin/../lib", "$FindBin::Bin/../conf" );
 }
-
+use Sys::Hostname;
+$hostname = hostname();
 $VERBOSE=1;
-$NOEXEC=1;
+$NOEXEC=0;
 
 $|++;
 
@@ -19,7 +20,20 @@
 die "Task file: $task_file does not exists" unless (-e $task_file);
 
 do $task_file;
-&{$task_func}(@ARGV);
+
+my $pair="";
+my $pname="";
+my $pval="";
+my $phash={};
+
+for $pair(@ARGV) {
+ ($pname, $pval)=split(/\s*=\s*/, $pair);
+ $phash->{$pname}=$pval;
+}
+
+
+
+&{$task_func}($phash);
 
 
 ## function called by the task scripts

--- NEW FILE: ispman.make_vhosts_conf ---
#!/usr/bin/perl
package ISPMan;

BEGIN {
    use FindBin;
    unshift @INC,
      ( $FindBin::Bin, "$FindBin::Bin/../lib", "$FindBin::Bin/../conf" );
      unless ($ARGV[0]){
         print "Usage: $FindBin::Script domain\n";
         exit;
      }
}

use Fcntl;
use POSIX qw(tmpnam);

use ISPMan;
$ispman = ISPMan->new();
require "$FindBin::Bin/../lib/http.lib";



my $template = $ispman->getTemplate("$FindBin::Bin/../templates/vhosts.conf.template");

&make_vhosts_conf($template, $ARGV[0]);


__END__



--- NEW FILE: ispman.modify_vhost ---
#!/usr/bin/perl
package ISPMan;

BEGIN {
    use FindBin;
    unshift @INC,
      ( $FindBin::Bin, "$FindBin::Bin/../lib", "$FindBin::Bin/../conf" );
}

use ISPMan;
$ispman = ISPMan->new();
require "$FindBin::Bin/../lib/http.lib";
# defind log_message.
# This is defined in ispman-agent and we should redefine here
sub logsay {
    my $message = join ' ', @_;
    chomp($message);
    print "$message\n";
}


&modify_vhost(@ARGV);


__END__





-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.