1

I would like to have the url call and if test done as batch, draft as shell script below, what would the Windows equivilent of the following shell script look like?

tmp=$( curl -s "http://server.my.lan/test.php" );

if [ $tmp == "0" ]; then
  # Windows calls 2 next lines, the action I would like if the URL does not return 0
  #net stop "World Wide Web Publishing Service"
  #net start "World Wide Web Publishing Service"
fi

What is the Windows equivilent of curl?

Wounded Knee
  • 11
  • 1
  • 4
  • possible duplicate of [steps to setup cURL in windows](http://stackoverflow.com/questions/9507353/steps-to-setup-curl-in-windows) – Adriano Repetti Jan 29 '14 at 07:11

2 Answers2

0

If you want to use curl on Windows you'll have to set it up. See this question: How do I install/set up and use cURL on Windows?

Community
  • 1
  • 1
Paul Keister
  • 12,243
  • 4
  • 41
  • 71
0

Download the standalone version of cURL for windows from here: http://curl.haxx.se/download.html

@echo off
for /f "delims=" %%a in ('curl -s "http://server.my.lan/test.php" ') do set "tmp=%%a"

if "%tmp%" equ "" (
  net stop "World Wide Web Publishing Service"
  net start "World Wide Web Publishing Service"
)
npocmaka
  • 51,748
  • 17
  • 123
  • 166