Index: trunk/tools/regpeek.pl
===================================================================
--- trunk/tools/regpeek.pl	(revision 34008)
+++ trunk/tools/regpeek.pl	(revision 34018)
@@ -4,4 +4,7 @@
 use Getopt::Long qw( GetOptions :config auto_help auto_version gnu_getopt );
 use PS::IPP::Config 1.0.1 qw( :standard );
+
+my $ipprc =  PS::IPP::Config->new(); # IPP Configuration
+my $siteConfig = $ipprc->{_siteConfig};
 
 my $dbname = 'gpc1';
@@ -66,13 +69,15 @@
 
 sub init_gpc_db {
-    ## change to use the site.config setting now, however may want to use replicated scidbs instead
-    my $ipprc =  PS::IPP::Config->new(); # IPP Configuration
-    my $siteConfig = $ipprc->{_siteConfig};
+    ## change to use the siteConfig setting, while readonly probably do not want to use a readonly replicated DB incase it gets behind
     use constant DB_SOCKET => '/var/run/mysqld/mysqld.sock';
-    # my $dbserver = 'ippdb01';
-    my $dbuser = 'ippuser';
-    my $dbpass = 'ippuser';
+    #my $dbserver = 'ippdb01';
+    #my $dbuser = 'ippuser';
+    #my $dbpass = 'ippuser';
     my $dbserver = metadataLookupStr($siteConfig, 'DBSERVER');
+    my $dbuser = metadataLookupStr($ipprc->{_siteConfig}, "RO_DBUSER");
+    my $dbpass = metadataLookupStr($ipprc->{_siteConfig}, "RO_DBPASSWORD");
     die "database configuration not set up" unless defined($dbserver);
+    die "database configuration not set up" unless defined($dbuser);
+    die "database configuration not set up" unless defined($dbpass);
     $db = DBI->connect("DBI:mysql:database=${dbname};host=${dbserver};" .
                        "mysql_socket=" . DB_SOCKET(),
