4 # print error message and exit immediately
5 programname="$(basename ${0})"
7 echo "${programname} **ERROR** $1"
11 # ensure a valid proxy is present for at least one hour
12 # if no proxy is found, try to create a new one
13 # return 0 if a valid proxy is found or created
14 # else return voms-proxy-init error code
15 function ensure_proxy {
16 voms-proxy-info --exists -valid 1:0 > /dev/null && return 0
17 voms-proxy-init --voms biomed -valid 24:00 || exit 1
20 # print prompt to ensure that the user want to continue further
21 # the user has to answer with 'y' to continue
23 prompt="${1:-is that correct?}"
24 read -p "${prompt} [y/n] " answer
25 test "${answer}" == "y" && return 0
26 test "${answer}" == "n" && return 1
27 check_user "${prompt}"
31 lfnbase="/grid/biomed/creatis/fgate/"
32 lfnrelease="${lfnbase}releases/"
33 lfnworkflow="${lfnbase}"
34 lfngasw="${lfnbase}gasw/"
35 lfnscript="${lfnbase}bin/"
37 # define the prefix for uploaded file
38 # default to local machine username
39 prefix="${USER:?"USER must be set"}_"