I need to create a batch sript to check if Internet is responding. If is responding then do nothing, but if no responding then post usernname and password to a URL. Bellow and example that I want to do, I know that the script is wrong and is for this rason that I am asking for help.
#!/bin/sh
if ping -c 1 8.8.8.8 &> /dev/null
then
do={/tool fetch http-method=post http-data="username=myuser&&password=mypass" url="https://secure.etecsa.net:8443//LoginServlet" }
else
echo 0
fi