From: rettenbe Date: Wed, 16 Jan 2008 14:03:36 +0000 (+0000) Subject: add sqlite-check.pl X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=d17296e6f64e59a950be6e7bdafded95dbd6774b;p=gosa.git add sqlite-check.pl git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8396 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-si/tests/sqlite-check.pl b/gosa-si/tests/sqlite-check.pl new file mode 100755 index 000000000..63f2ac6d8 --- /dev/null +++ b/gosa-si/tests/sqlite-check.pl @@ -0,0 +1,95 @@ +#!/usr/bin/perl +#=============================================================================== +# +# FILE: DBD-SQlite.pl +# +# USAGE: ./DBD-SQlite.pl +# +# DESCRIPTION: +# +# OPTIONS: --- +# REQUIREMENTS: --- +# BUGS: --- +# NOTES: --- +# AUTHOR: (), <> +# COMPANY: +# VERSION: 1.0 +# CREATED: 20.12.2007 08:54:52 CET +# REVISION: --- +#=============================================================================== + +use strict; +use warnings; +use GOSA::DBsqlite; + + +print "START\n"; +my $res; +my $db_name; + +$db_name = "/var/lib/gosa-si/jobs.db"; +if (-e $db_name) { + print "\n############################################################\n"; + $db_name =~ /\/([^\/]*?)\.db$/; + my $table_name = $1; + print "$db_name\n"; + print "$table_name\n"; + my $sqlite = GOSA::DBsqlite->new($db_name); + my $col_names = $sqlite->get_table_columns($table_name); + print join(', ', @{ $col_names } )."\n" ; + my $answer = $sqlite->show_table($table_name); + print $answer."\n"; +} + + +$db_name = "/var/lib/gosa-si/known_clients.db"; +if (-e $db_name) { + print "\n############################################################\n"; + $db_name =~ /\/([^\/]*?)\.db$/; + my $table_name = $1; + + print "$db_name\n"; + print "$table_name\n"; + + my $sqlite = GOSA::DBsqlite->new($db_name); + my $col_names = $sqlite->get_table_columns($table_name); + print join(', ', @{ $col_names } )."\n" ; + my $answer = $sqlite->show_table($table_name); + print $answer."\n"; +} + + +$db_name = "/var/lib/gosa-si/known_server.db"; +if (-e $db_name) { + print "\n############################################################\n"; + $db_name =~ /\/([^\/]*?)\.db$/; + my $table_name = $1; + + print "$db_name\n"; + print "$table_name\n"; + + my $sqlite = GOSA::DBsqlite->new($db_name); + my $col_names = $sqlite->get_table_columns($table_name); + print join(', ', @{ $col_names } )."\n" ; + my $answer = $sqlite->show_table($table_name); + print $answer."\n"; +} + + +$db_name = "/var/lib/gosa-si/bus_known_server.db"; +if (-e $db_name) { + print "\n############################################################\n"; + $db_name =~ /\/([^\/]*?)\.db$/; + my $table_name = $1; + print "$db_name\n"; + print "$table_name\n"; + my $sqlite = GOSA::DBsqlite->new($db_name); + my $col_names = $sqlite->get_table_columns($table_name); + print join(', ', @{ $col_names } )."\n" ; + my $answer = $sqlite->show_table($table_name); + print $answer."\n"; +} + + + +print "\nFINISH\n";