summaryrefslogtreecommitdiffstats
path: root/config-db/test-config-demuxer.pl
diff options
context:
space:
mode:
authorOliver Tappe2006-09-26 20:37:20 +0200
committerOliver Tappe2006-09-26 20:37:20 +0200
commit09c5818eb1fd37f24d3be17e74cc0b75f3e352c8 (patch)
treeb68f58f05ea5d1462dd7597a492d6408e671aee3 /config-db/test-config-demuxer.pl
parent* fixed generation of client-config file, env-vars do not like spaces in init... (diff)
downloadcore-09c5818eb1fd37f24d3be17e74cc0b75f3e352c8.tar.gz
core-09c5818eb1fd37f24d3be17e74cc0b75f3e352c8.tar.xz
core-09c5818eb1fd37f24d3be17e74cc0b75f3e352c8.zip
* some work on the testing script, fixed several errors on the way
git-svn-id: http://svn.openslx.org/svn/openslx/trunk@393 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'config-db/test-config-demuxer.pl')
-rwxr-xr-xconfig-db/test-config-demuxer.pl30
1 files changed, 28 insertions, 2 deletions
diff --git a/config-db/test-config-demuxer.pl b/config-db/test-config-demuxer.pl
index 8132ab4a..5918b0d7 100755
--- a/config-db/test-config-demuxer.pl
+++ b/config-db/test-config-demuxer.pl
@@ -1,4 +1,5 @@
#! /usr/bin/perl
+use strict;
# add the folder this script lives in to perl's search path for modules:
use FindBin;
@@ -7,20 +8,45 @@ use lib $FindBin::Bin;
use OpenSLX::Basics;
use OpenSLX::ConfigDB qw(:access :manipulation);
+use Getopt::Long qw(:config pass_through);
+my $clobber;
+GetOptions(
+ 'clobber' => \$clobber
+ # clobber causes this script to overwrite the database without asking
+);
+
openslxInit();
my $openslxDB = connectConfigDB();
+if (!$clobber) {
+ my $yes = _tr('yes');
+ my $no = _tr('no');
+ my @systems = fetchSystemsByFilter($openslxDB);
+ my @clients = fetchClientsByFilter($openslxDB);
+ print _tr(qq[This will overwrite the current OpenSLX-database with an example dataset.
+All your data (%s systems and %s clients) will be lost!
+Do you want to continue(%s/%s)? ], scalar(@systems), scalar(@clients), $yes, $no);
+ my $answer = <>;
+ if ($answer !~ m[^\s*$yes]i) {
+ print "no - stopping\n";
+ exit 5;
+ }
+ print "yes - starting...\n";
+}
+
+emptyDatabase($openslxDB);
+
addVendorOS($openslxDB, {
'name' => "suse-10-minimal",
- 'comment' => "SuSE 9.3 minimale Installation",
+ 'comment' => "SuSE 10 minimale Installation",
'path' => "suse-10.0",
# relative to /var/lib/openslx/stage1
});
addVendorOS($openslxDB, {
'name' => "suse-10-KDE",
- 'comment' => "SuSE 9.3 grafische Installation mit KDE",
+ 'comment' => "SuSE 10 grafische Installation mit KDE",
'path' => "suse-10.0",
});