Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:03:14

0001 #!/bin/bash
0002 
0003 tflag=0
0004 rflag=0
0005 gflag=0
0006 while getopts 'trgh' OPTION
0007   do
0008   case $OPTION in
0009       t) tflag=1
0010           ;;
0011       r) rflag=1
0012           ;;
0013       g) gflag=1
0014           ;;
0015       h) echo "Usage: [-tr] L1_KEY"
0016           echo "  -t: print TSC key"
0017           echo "  -r: print RS keys"
0018           echo "  -g: GT RS keys only"
0019           exit
0020           ;;
0021   esac
0022 done
0023 shift $(($OPTIND - 1))
0024 
0025 getColumnFromL1Key()
0026 {
0027   COLUMN=$1
0028 
0029   DB="cms_omds_lb"
0030   USER="cms_trg_r"
0031   PASSWORD_FILE=/nfshome0/centraltspro/secure/$USER.txt
0032   PASSWORD=`cat $PASSWORD_FILE`
0033 
0034   RESULT=`sqlplus -s <<!
0035     $USER/$PASSWORD@$DB
0036     SET FEEDBACK OFF;
0037     SET HEADING OFF;
0038     SET LINESIZE 500;
0039     select $COLUMN
0040     from CMS_TRG_L1_CONF.L1_CONF_DETAILS_VIEW
0041     where L1_KEY='$L1_KEY';
0042     !
0043 !`
0044   
0045   echo $RESULT
0046 }
0047 
0048 if [[ $# != 1 ]]; then
0049   echo "Usage:"
0050   echo "$0 <L1 key>"
0051   exit 1
0052 fi
0053 
0054 L1_KEY=$1
0055 
0056 if [ ${tflag} -eq 1 ]
0057     then
0058     TSC_KEY=`getColumnFromL1Key TSC_KEY`
0059     echo ${TSC_KEY}
0060 fi
0061 
0062 exit 0
0063 
0064 EOF