From ee3e6061f0b634f8c12cd068107eaf10c2eab949 Mon Sep 17 00:00:00 2001 From: lissav Date: Mon, 20 May 2013 11:02:04 +0000 Subject: [PATCH] Add setup of postgresql git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.8@16362 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT/postscripts/odbcsetup | 36 +++++++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) diff --git a/xCAT/postscripts/odbcsetup b/xCAT/postscripts/odbcsetup index 71ab5e501..318268365 100755 --- a/xCAT/postscripts/odbcsetup +++ b/xCAT/postscripts/odbcsetup @@ -64,12 +64,18 @@ else `logger -t xcat -p local4.info $msg`; &setupmysqlodbc; } - else - { + else { + if ($dbname eq "PG") + { + $msg = "odbcsetup:Setting up ODBC for PostgreSQL"; + `logger -t xcat -p local4.info $msg`; + &setupPGodbc; + } else { $msg = - "odbcsetup:cfgloc file does not contain MySQL or DB2, will not setup ODBC."; + "odbcsetup:cfgloc file does not contain MySQL, DB2 or PG, will not setup ODBC."; `logger -t xcat -p local4.err $msg`; exit 1; + } } } @@ -140,6 +146,30 @@ sub setupmysqlodbc } +##################################################### +# +# setupPGodbc +# runs the pgsqlsetup script and sets up the ODBC on the Client +# +##################################################### +sub setupPGodbc +{ + my $msg; + my $rc = 0; + my $cmd; + $cmd = "$::XCATROOT/bin/pgsqlsetup -o"; + $msg = "odbcsetup: Running Client ODBC setup. \"$cmd\"\n"; + `logger -t xcat -p local4.info $msg`; + + $rc = &runcmd($cmd); + + $msg = "odbcsetup: Client ODBC setup finished.\n"; + `logger -t xcat -p local4.info $msg`; + + return $rc; + +} + # # run the command #