diff --git a/xCAT-server/sbin/runsqlcmd b/xCAT-server/sbin/runsqlcmd index 65b2f4d9b..81ce44b8d 100755 --- a/xCAT-server/sbin/runsqlcmd +++ b/xCAT-server/sbin/runsqlcmd @@ -90,6 +90,11 @@ my @sqlfilelist = xCAT::Table->get_filelist($directory, \@filearray, "sql"); # determine database my $xcatcfg = xCAT::Table->get_xcatcfg(); +if ($xcatcfg =~ /^SQLite:/) +{ + xCAT::MsgUtils->message("SE", + "The runsqlcmd does not support the SQLite database."); +} foreach my $file (@sqlfilelist) { if ($xcatcfg =~ /^DB2:/) @@ -106,12 +111,14 @@ foreach my $file (@sqlfilelist) } if ($xcatcfg =~ /^SQLite:/) { + # not supported but will leave routine in case we change our mind &runsqlitecmd($file,$xcatcfg); + exit 1; } } -exit; +exit 0; ##################################### # subroutines @@ -131,10 +138,10 @@ sub usage { xCAT::MsgUtils->message( 'I', - "Usage:\nrunsqlcmd - runs the sql commands in files located in /opt/xcat/lib/perl/xCAT_schema by default or the directory input with -d or the list of files input with the -f flag." + "Usage:\nRuns the sql commands in files located in /opt/xcat/lib/perl/xCAT_schema by default or the directory input with -d or the list of files input with the -f flag. Supports DB2,PostgreSQL,MySQL." ); my $msg = - "runsqlcmd <-h|--help>\n <-v|--version>\n <-d|--dir>\n <-f|--files>\n"; + "runsqlcmd <-h|--help>\n <-v|--version>\n <-d|--dir>\n <-f|--files>\n"; xCAT::MsgUtils->message('I', "$msg"); } @@ -285,10 +292,6 @@ sub runsqlitecmd { my $file = shift; my $xcatcfg = shift; - my ($front, $back) = split('\;', $xcatcfg); - my ($prefix, $dbname) = split('=', $front); - my ($host, $admin, $passwd) = split('\|', $back); - my ($hostind, $hostname) = split('=', $host); return; }