Commit d6509c1c authored by Andrea Sciaba's avatar Andrea Sciaba
Browse files

added timeout to curl

parent 3431c3c6
...@@ -69,7 +69,6 @@ echo "Printing CMS site local config information..." ...@@ -69,7 +69,6 @@ echo "Printing CMS site local config information..."
echo echo
echo Hostname: `hostname` echo Hostname: `hostname`
tmpfile=`mktemp /tmp/tmp.XXXXXXXXXX` tmpfile=`mktemp /tmp/tmp.XXXXXXXXXX`
echo "SCRAM_ARCH: $SCRAM_ARCH"
source $SW_DIR/cmsset_default.sh > $tmpfile 2>&1 source $SW_DIR/cmsset_default.sh > $tmpfile 2>&1
result=$? result=$?
echo "SCRAM_ARCH: $SCRAM_ARCH" echo "SCRAM_ARCH: $SCRAM_ARCH"
......
...@@ -53,14 +53,14 @@ if [ $useSquid == 1 ] ; then ...@@ -53,14 +53,14 @@ if [ $useSquid == 1 ] ; then
fi fi
wgetOutput=`mktemp` wgetOutput=`mktemp`
cmd="curl --fail --request GET --header \"PRIVATE-TOKEN: kuD9s3WrDGNXZ8BvxFV2\" $url -o $file" cmd="curl --connect-timeout 30 -m 30 --fail --request GET --header \"PRIVATE-TOKEN: kuD9s3WrDGNXZ8BvxFV2\" $url -o $file"
cmdFile=`mktemp` cmdFile=`mktemp`
echo "$cmd > $wgetOutput 2>&1" > $cmdFile echo "$cmd > $wgetOutput 2>&1" > $cmdFile
source $cmdFile source $cmdFile
rc=$? rc=$?
if [ $rc != 0 ] ; then if [ $rc != 0 ] ; then
echo "wget error code: $rc" echo "curl error code: $rc"
cat $wgetOutput cat $wgetOutput
if [ $useSquid == 0 ] ; then if [ $useSquid == 0 ] ; then
echo "ERROR: Failed to retrieve $file from $url" echo "ERROR: Failed to retrieve $file from $url"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment