--- DarthVader/src/R2-D2.cpp 2006/09/06 15:20:23 1.4 +++ DarthVader/src/R2-D2.cpp 2006/09/07 09:47:08 1.6 @@ -32,9 +32,9 @@ printf("\n -v | --verbose be verbose [default: print nothing on STDOUT]\n"); printf("\n -idRun ID_RUN: ID number of the run \n"); printf("\n -filename output yoda filename \n"); - printf("\n -host name for the host [default = mysql://localhost/pamelaprod]\n"); - printf("\n -user username for the DB [default = anonymous] \n"); - printf("\n -psw password for the DB [default = \"\"]\n"); + printf("\n -host name for the host [default = $PAM_DBHOST or mysql://localhost/pamelaprod]\n"); + printf("\n -user username for the DB [default = $PAM_DBUSER or \"anonymous\"] \n"); + printf("\n -psw password for the DB [default = $PAM_DBPSW or \"\"]\n"); printf("\n -convert [ -tzone timezone -dbtime dbtime ] \n"); printf("\n convert the dbtime given in seconds (from the DB) to a string for\n"); printf("\n the given time zone (UTC,GMT,MSK,MSD,CET,CEST are accepted) \n"); @@ -63,6 +63,16 @@ TString host = "mysql://localhost/pamelaprod"; TString user = "anonymous"; TString psw = ""; + // + const char *pamdbhost=gSystem->Getenv("PAM_DBHOST"); + const char *pamdbuser=gSystem->Getenv("PAM_DBUSER"); + const char *pamdbpsw=gSystem->Getenv("PAM_DBPSW"); + if ( strcmp(pamdbhost,"") ) host = pamdbhost; + if ( strcmp(pamdbuser,"") ) user = pamdbuser; + if ( strcmp(pamdbpsw,"") ) psw = pamdbpsw; + // + // printf(" host %s user %s psw %s \n",host.Data(),user.Data(),psw.Data()); + // TString tzone = "MSK"; TString tzone2 = "MSK"; TString runtime = "1970-01-01 00:00:00";