curl获取HTTP返回状态码
- -o /dev/null 屏蔽原有输出信息
- -s silent
- -w %{http_code} 控制额外输出
- -I 仅测试HTTP头
- -m 10 最多查询10s
#!/bin/bash status_code=curl -I -m 10 -o /dev/null -s -w %{http_code} www.baidu.com
#!/bin/bash status_code=$(curl -H "Content-Type: application/json" -o /dev/null -s -w %{htt p_code} -XPUT -d ‘ { "type": "fs", "settings": { "location": "‘${NFS_DIR}‘/‘${REPO_DIR}‘", "max_snapshot_bytes_per_sec": "50mb", "max_restore_bytes_per_sec": "50mb" } }‘ ${ES_URL}/_snapshot/${REPO_DIR})
相关推荐
83911535 2020-11-13
曾是土木人 2020-10-31
yegen00 2020-10-21
soralaro 2020-10-11
katanaFlower 2020-09-18
wytzsjzly 2020-08-17
88407710 2020-08-17
ChinaJoeEE 2020-08-16
CyborgLin 2020-08-15
Blueberry 2020-08-15
PinkBean 2020-08-11
katanaFlower 2020-08-03
hunningtu 2020-07-30
pingyan 2020-06-25
wytzsjzly 2020-06-25
阳光岛主 2020-06-25
阿债的方寸天地 2020-06-16
阳光岛主 2020-06-14