make_sam_wrapper.sh
Go to the documentation of this file.
1 #! /bin/bash
2 
3 #------------------------------------------------------------------
4 #
5 # Purpose: Generate a sam wrapper fcl file.
6 #
7 # Usage: make_sam_wrapper.sh <job-fcl> <project-url> <consumer-process-id>
8 #
9 # Notes:
10 #
11 # 1. This script is invoked with three positional arguments, all
12 # of which are required.
13 #
14 # 2. The wrapper fcl file is written to standard output. This
15 # output should normally be captured to a file.
16 #
17 # Created: H. Greenlee, 30-Jul-2013
18 #
19 #------------------------------------------------------------------
20 
21 jobfcl=''
22 prjurl=''
23 cpid=''
24 
25 if [ $# -ne 3 ]; then
26  echo "Usage: make_sam_wrapper.sh <job-fcl> <project-url> <consumer-process-id>" >&2
27  exit 1
28 fi
29 jobfcl=$1
30 prjurl=$2
31 cpid=$3
32 
33 cat <<EOF
34 #include "${jobfcl}"
35 
36 services.IFDH:
37 {
38  IFDH_BASE_URI: "http://samweb.fnal.gov:8480/sam/uboone/api"
39 }
40 
41 services.CatalogInterface:
42 {
43  service_provider: "IFCatalogInterface"
44  webURI: "${prjurl}"
45 }
46 
47 services.FileTransfer:
48 {
49  service_provider: "IFFileTransfer"
50 }
51 
52 source.fileNames: [ "${cpid}" ]
53 
54 EOF