ispman/bin ispman.database,1.3,1.4

Joerg Delker <[email protected]> Sat, 03 Jan 2009 12:21:07 +0000
Newsgroups gmane.comp.isp.ispman.cvs
Message-ID <[email protected]>
Update of /cvsroot/ispman/ispman/bin
In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv19854/bin

Modified Files:
	ispman.database 
Log Message:
added database sql action feature

Index: ispman.database
===================================================================
RCS file: /cvsroot/ispman/ispman/bin/ispman.database,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- ispman.database	30 Dec 2008 12:59:49 -0000	1.3
+++ ispman.database	3 Jan 2009 12:21:04 -0000	1.4
@@ -13,9 +13,12 @@
         print "Syntax:\n";
         print "$FindBin::Script list -d <domain> [-x]\n";
         print "$FindBin::Script get -d <domain> -n <dbname> [-x]\n";
-        print "$FindBin::Script add -d <domain> -o <dbtype,dbname,dbuser,dbpass,dbfilter,dbpriv|dbpriv,dbhost> [-x]\n";
-        print "$FindBin::Script modify -d <domain> -n <dbname> -o <dbtype,dbname,dbuser,dbpass,dbfilter,dbpriv|dbpriv,dbhost> [-x]\n";
-        print "$FindBin::Script delete -d <domain> -n <dbname> [-x]\n";
+        print "$FindBin::Script add -d <domain> -o <dbtype,dbname,dbuser,dbpass,dbfilter,dbpriv|dbpriv,dbhost> [-a script1.sql|script2.sql]\n";
+        print "$FindBin::Script modify -d <domain> -n <dbname> -o <dbtype,dbname,dbuser,dbpass,dbfilter,dbpriv|dbpriv,dbhost>\n";
+        print "$FindBin::Script delete -d <domain> -n <dbname>\n";
+        print "Options:\n";
+        print "-x	Output of perl hash as parsable dump\n";
+        print "-a	Optional SQL action scripts invoked on db creation\n";
         print "\n";
         exit 1;
 }
@@ -69,7 +72,7 @@
 ###################################################
 # delete
 if ($action eq "delete") {
-  getopts( 'd:n:x', \%opts );
+  getopts( 'd:n:', \%opts );
 
   usage() unless $opts{'n'} && $opts{'d'};
 
@@ -79,7 +82,7 @@
 ###################################################
 # add
 if ($action eq "add") {
-  getopts( 'd:o:x', \%opts );
+  getopts( 'd:o:a:', \%opts );
 
   usage() unless $opts{'d'} && $opts{'o'};;
 
@@ -93,8 +96,10 @@
     $dbhash->{$_}=pop @dbdata;
   }
 
+  my @actions = split('\|',$opts{'a'});
+
   # add database
-  ($ispman->add_database($opts{'d'},$dbhash))?exit 0:exit 1;
+  ($ispman->add_database($opts{'d'},$dbhash,\@actions))?exit 0:exit 1;
 }
 
 ###################################################


------------------------------------------------------------------------------