@SBK ,
I thought of the same strategy last night, and I assure you that /otm has 777 octal permissions; I checked a few times just for my own sanity, and here is a screen shot:
As for capturing the output of the curl command, I did exactly as you suggested, and their is no output, and no error either. I thought perhaps some quoting my help so on lines 38 and 39 I inserted the set -e and set -x commands. set -x prints out all of the commands executed in the script along with values assigned to variables. set -e stops execution at the 1st error thrown. We can see exactly what is going on line-by-line as the script executes. Here is a copy of that part of the script with my edit:
until [[ ${OTM_HTTP_STATUS} -eq 200 && ! -z ${OTM_REMOTE_LENGTH} ]]
do
sleep 5
##
echo "Receiving binary location"
set -e
set -x
BINARY_LOCATION=$(curl -m 20 -s -u $USERNAME:$PASSWORD --connect-timeout 10 -X POST https://www.foxymon.com/receiver/receiver2.php -F function=receive_binary_location)
echo "Getting the OTM Package"
curl -I -m 30 --connect-timeout 15 "$BINARY_LOCATION" -o $STARTING_FOLDER/otminfo.log
OTM_HTTP_STATUS=$(cat $STARTING_FOLDER/otminfo.log | awk '/HTTP/ {print $2}')
OTM_REMOTE_LENGTH=$( cat $STARTING_FOLDER/otminfo.log | awk '/content-length/ {print $2}' | sed -e 's/[\r\n]//g' )
done
And here is screen shot of the execution:
And as you can see, I copied the curl command an ran it a few times directly on a command line... it just runs silently. The second curl command throws an error since the variable $BINARY_LOCATION is empty, and the script stops on that error.
It turns out it is a network issue and I don't no how to deal with it. I hope you guys do. I did this:
Packet transmission is always stopped by the same host eth.14.2.cr2.phx0.phoenixnap.com. Since no packets ever reach www.foxymon.com, the 1st curl command has no output since $BINARY_LOCATION is empty.
Any ideas?
cwa