I have a script to run wget to execute a script from remote server
remoteHost="greatwall.bo.apac.fedex.com"
uploadcanhfilenm="testfilename.bry"
WGET=/usr/local/bin/wget
URL="http://${remoteHost}/cnaccs/szx2canip.cgi?rdefn=${uploadcanhfilenm}"
echo "$WGET --post-file /tmp/Bryan/testWGET/testbryfile.out --no-proxy -O- -q $URL"
resbuf=$($WGET --post-file /tmp/Bryan/testWGET/testbryfile.out --no-proxy -O- -q $URL 2>&1)
echo $?
echo "resbuf:$resbuf"
but echo $? returns 8 and resbuf variabile is blank, seems that wget is not working.
did a quick google search and exit status 8 means that Code 8 : Server issued an error response.
How can I resolve this issue? Thanks
UPDATE
I received this kind of error when I removed -q option
--2022-09-20 05:43:20-- http://greatwall.bo.apac.fedex.com/cnaccs/szx2ca nip.cgi?rdefn=testfilename.bry
Resolving greatwall.bo.apac.fedex.com... 10.45.35.112
Connecting to greatwall.bo.apac.fedex.com|10.45.35.112|:80... connected.
HTTP request sent, awaiting response... 503 Service Unavailable
2022-09-20 05:43:20 ERROR 503: Service Unavailable.
UPDATE no 2
I checked apache logs from remote server and encountered this errorlog
[Tue Sep 20 06:15:13.138573 2022] [cgid:error] [pid 607253:tid 140225758086912] (13)Permission denied: [client 10.45.12.58:35193] AH01257: unable to connect to cgi daemon after multiple tries: /v6/centera/cnaccs/szx2canip.cgi