我正在使用下面的Shell脚本来获取订阅者,我正在获取订阅者的详细信息,只是想要捕获状态代码,如200,400,500等作为响应?
if [ $Action3 == "GetSubscriber" ]
then
echo "
curl -v -k -x $proxyhost:$proxyport -X GET \
https://edge-tel-hw-pro.tel-pro.homewifi.fon.com/subscribers/subscribers/agents/$agent_uuid/subscribers?home_wifi_id="$MAC_to_search" \
-H 'Accept: */*' \
-H 'Authorization:$agent_access_token' \
-H 'Cache-Control: no-cache' \
-H 'Connection: keep-alive' \
-H 'Host: edge-tel-hw-pro.tel-pro.homewifi.fon.com' \
-H 'cache-control: no-cache'>$SDIR/output_Mac.json"
curl -v -k -x $proxyhost:$proxyport -X GET \
https://edge-tel-hw-pro.tel-pro.homewifi.fon.com/subscribers/subscribers/agents/"$agent_uuid"/subscribers?home_wifi_id="$MAC_to_search" \
-H 'Accept: */*' \
-H Authorization:"$agent_access_token" \
-H 'Cache-Control: no-cache' \
-H 'Connection: keep-alive' \
-H 'Host: edge-tel-hw-pro.tel-pro.homewifi.fon.com' \
-H 'cache-control: no-cache'>$SDIR/output_Mac.json
fi发布于 2020-09-01 19:29:37
我在请求中使用了代码-w Status="%{http_code}“,可以捕获状态。
https://stackoverflow.com/questions/63685998
复制相似问题