ispman/tasks AddVirtualHost_task.pl, 1.1, 1.2 DeleteVirtualHost_task.pl, 1.4, 1.5 ModifyVirtualHost_task.pl, 1.1, 1.2
Joerg Delker <[email protected]> Mon, 18 Sep 2006 20:55:54 +0000
| Newsgroups | gmane.comp.isp.ispman.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/ispman/ispman/tasks
In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv9780/tasks
Modified Files:
AddVirtualHost_task.pl DeleteVirtualHost_task.pl
ModifyVirtualHost_task.pl
Log Message:
using libs directly instead of cli tools
(fixing [ 1561014 ] more CLI flaws)
Index: AddVirtualHost_task.pl
===================================================================
RCS file: /cvsroot/ispman/ispman/tasks/AddVirtualHost_task.pl,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- AddVirtualHost_task.pl 30 Dec 2004 04:15:43 -0000 1.1
+++ AddVirtualHost_task.pl 18 Sep 2006 20:55:52 -0000 1.2
@@ -1,17 +1,23 @@
sub AddVirtualHost_task {
- my $params=shift;
- unless ($params->{'domain'}){
- print "Domain not defined. Cannot continue\n";
- return 0;
- }
- unless ($params->{'ispmanVhostName'}){
- print "Vhostname not defined. Cannot continue\n";
- return 0;
- }
- push @cmd, "perl $FindBin::Bin/ispman.add_vhost $params->{'ispmanVhostName'} $params->{'domain'}";
- push @cmd, "perl $FindBin::Bin/ispman.make_vhosts_conf $params->{'domain'}";
- push @cmd, "perl $FindBin::Bin/ispman.reloadApache";
+ my $params = shift;
+ unless ( $params->{'domain'} ) {
+ print STDERR "Domain not defined. Cannot continue\n";
+ return 0;
+ }
+ unless ( $params->{'ispmanVhostName'} ) {
+ print STDERR "Vhostname not defined. Cannot continue\n";
+ return 0;
+ }
+ # require our http interface library
+ require "http.lib";
+ # add vhost to configuration
+ add_vhost( $params->{'ispmanVhostName'}, $params->{'domain'} );
+ # generate webserver configuration
+ make_vhosts_conf( $params->{'domain'} );
+
+ # reload webserver
+ return reloadServer();
}
Index: ModifyVirtualHost_task.pl
===================================================================
RCS file: /cvsroot/ispman/ispman/tasks/ModifyVirtualHost_task.pl,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- ModifyVirtualHost_task.pl 30 Dec 2004 04:32:27 -0000 1.1
+++ ModifyVirtualHost_task.pl 18 Sep 2006 20:55:52 -0000 1.2
@@ -1,17 +1,23 @@
sub ModifyVirtualHost_task {
- my $params=shift;
- unless ($params->{'domain'}){
- print "Domain not defined. Cannot continue\n";
- return 0;
- }
- unless ($params->{'ispmanVhostName'}){
- print "Vhostname not defined. Cannot continue\n";
- return 0;
- }
- push @cmd, "perl $FindBin::Bin/ispman.modify_vhost $params->{'ispmanVhostName'} $params->{'domain'}";
- push @cmd, "perl $FindBin::Bin/ispman.make_vhosts_conf $params->{'domain'}";
- push @cmd, "perl $FindBin::Bin/ispman.reloadApache";
+ my $params = shift;
+ unless ( $params->{'domain'} ) {
+ print STDERR "Domain not defined. Cannot continue\n";
+ return 0;
+ }
+ unless ( $params->{'ispmanVhostName'} ) {
+ print STDERR "Vhostname not defined. Cannot continue\n";
+ return 0;
+ }
+ require "http.lib";
+ # modify vhost config
+ modify_vhost( $params->{'ispmanVhostName'}, $params->{'domain'} );
+
+ # generate configuration
+ make_vhosts_conf( $params->{'domain'} );
+
+ # reload webserver
+ return reloadServer();
}
Index: DeleteVirtualHost_task.pl
===================================================================
RCS file: /cvsroot/ispman/ispman/tasks/DeleteVirtualHost_task.pl,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- DeleteVirtualHost_task.pl 30 Dec 2004 04:32:25 -0000 1.4
+++ DeleteVirtualHost_task.pl 18 Sep 2006 20:55:52 -0000 1.5
@@ -1,20 +1,23 @@
#!/usr/bin/perl
sub DeleteVirtualHost_task {
- my $params=shift;
-
- unless ($params->{'domain'}){
- print "Domain not defined. Cannot continue\n";
- return 0;
- }
- unless ($params->{'ispmanVhostName'}){
- print "Vhostname not defined. Cannot continue\n";
- return 0;
- }
+ my $params = shift;
+ unless ( $params->{'domain'} ) {
+ print STDERR "Domain not defined. Cannot continue\n";
+ return 0;
+ }
+ unless ( $params->{'ispmanVhostName'} ) {
+ print STDERR "Vhostname not defined. Cannot continue\n";
+ return 0;
+ }
- push @cmd, "perl $FindBin::Bin/ispman.delete_vhost $params->{'ispmanVhostName'} $params->{'domain'} ";
- push @cmd, "perl $FindBin::Bin/ispman.make_vhosts_conf $params->{'domain'} ";
- push @cmd, "perl $FindBin::Bin/ispman.reloadApache";
+ # delete vhost config
+ delete_vhost( $params->{'ispmanVhostName'}, $params->{'domain'} );
+ # generate webserver configuration
+ make_vhosts_conf( $params->{'domain'} );
+
+ # reload webserver
+ return reloadServer();
}
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV