ispman/bin ispman.addProcess,1.1,1.2
Joerg Delker <[email protected]> Mon, 02 Oct 2006 20:26:55 +0000
| Newsgroups | gmane.comp.isp.ispman.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvsroot/ispman/ispman/bin
In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv18597/bin
Modified Files:
ispman.addProcess
Log Message:
fixed bug [ 1569403 ] Hardcoded Paths
Index: ispman.addProcess
===================================================================
RCS file: /cvsroot/ispman/ispman/bin/ispman.addProcess,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- ispman.addProcess 5 Feb 2005 14:15:47 -0000 1.1
+++ ispman.addProcess 2 Oct 2006 20:26:53 -0000 1.2
@@ -1,28 +1,32 @@
#!/usr/bin/perl
-BEGIN{
- use Getopt::Std;
- getopt('dpghx', \%opts);
- unless ($opts{'d'} && $opts{'p'} && ($opts{'g'} || $opts{'h'})){
- print "Usage: ispman.addProcess -d domain -p process (-g hostgroup |-h hostname) [-x params]\n";
- print "Example: ispman.addProcess -d example.com -p ModifyVirtualHost -g httpgroup -x ispmanVhostName=www\n";
- exit;
- }
+BEGIN {
+ use FindBin;
+ unshift @INC,
+ ( $FindBin::Bin, "$FindBin::Bin/../lib", "$FindBin::Bin/../conf" );
+ use Getopt::Std;
+ getopt( 'dpghx', \%opts );
+ unless ( $opts{'d'} && $opts{'p'} && ( $opts{'g'} || $opts{'h'} ) ) {
+ print
+ "Usage: ispman.addProcess -d domain -p process (-g hostgroup |-h hostname) [-x params]\n";
+ print
+ "Example: ispman.addProcess -d example.com -p ModifyVirtualHost -g httpgroup -x ispmanVhostName=www\n";
+ exit;
+ }
}
-use lib qw(/opt/ispman/lib);
use ISPMan;
-my $ispman=ISPMan->new();
+my $ispman = ISPMan->new();
-my $domain=$opts{'d'};
-my $process=$opts{'p'};
-my $params=$opts{'x'};
+my $domain = $opts{'d'};
+my $process = $opts{'p'};
+my $params = $opts{'x'};
-if ($opts{'g'}) {
- $ispman->addProcessToGroup($domain,$opts{'g'},$process,$params);
+if ( $opts{'g'} ) {
+ $ispman->addProcessToGroup( $domain, $opts{'g'}, $process, $params );
}
-if ($opts{'h'}) {
- $ispman->addProcessToHost($domain,$opts{'h'},$process,$params);
+if ( $opts{'h'} ) {
+ $ispman->addProcessToHost( $domain, $opts{'h'}, $process, $params );
}
__END__
-------------------------------------------------------------------------
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