[FreeBSD] Added authentication support
This commit is contained in:
parent
5d2d49fa04
commit
06e10c3349
@ -1,10 +1,23 @@
|
|||||||
#!/bin/csh -f
|
#!/bin/csh -f
|
||||||
set URL=$1
|
set MODE=$1
|
||||||
set HS=$2
|
|
||||||
set STATUS=`curl -L -o /dev/null -s -w "%{http_code}\n" -m 1 $URL`
|
if ($MODE == no_auth) then
|
||||||
|
set URL=$2
|
||||||
|
set HS=$3
|
||||||
|
set STATUS=`curl -L -o /dev/null -s -w "%{http_code}\n" -m 1 $URL`
|
||||||
|
|
||||||
|
else if ($MODE == auth) then
|
||||||
|
set AUTH=$2
|
||||||
|
set URL=$3
|
||||||
|
set HS=$4
|
||||||
|
set STATUS=`curl -L -o /dev/null -s -w "%{http_code}\n" -m 1 --user $AUTH $URL`
|
||||||
|
|
||||||
|
else
|
||||||
|
exit 1
|
||||||
|
endif
|
||||||
|
|
||||||
if ($STATUS == 200) then
|
if ($STATUS == 200) then
|
||||||
/usr/local/bin/curl -fsS --retry 3 $HS > /dev/null
|
/usr/local/bin/curl -fsS --retry 3 $HS > /dev/null
|
||||||
else
|
else
|
||||||
exit 1
|
exit 1
|
||||||
endif
|
endif
|
Loading…
Reference in New Issue
Block a user