change that to '-sS' will silent output but the error info
Signed-off-by: Liu Yinsi liuyinsi@163.com --- container/logging-es/start | 2 +- sbin/es-accounts-mapping.sh | 4 ++-- sbin/es-jobs-mapping.sh | 6 +++--- sbin/es-regression-mapping.sh | 4 ++-- sbin/es-repo-mapping.sh | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/container/logging-es/start b/container/logging-es/start index 25ed36b..66464e6 100755 --- a/container/logging-es/start +++ b/container/logging-es/start @@ -23,7 +23,7 @@ cmd=( echo "Please wait 60s for setting index" sleep 60
-curl -H "Content-Type: application/json" -XPUT "localhost:9202/_settings" -d ' +curl -sSH "Content-Type: application/json" -XPUT "localhost:9202/_settings" -d ' { "index": { "refresh_interval": "120s", diff --git a/sbin/es-accounts-mapping.sh b/sbin/es-accounts-mapping.sh index 635f4fc..d5566dc 100755 --- a/sbin/es-accounts-mapping.sh +++ b/sbin/es-accounts-mapping.sh @@ -3,14 +3,14 @@ # Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved.
# check whether accounts index has created -status_code=$(curl -sIL -w "%{http_code}\n" -o /dev/null http://localhost:9200/accounts) +status_code=$(curl -sSIL -w "%{http_code}\n" -o /dev/null http://localhost:9200/accounts)
if [ "$status_code" -eq 200 ] then echo "accounts index has been created, exit." else echo "begin create index." - curl -H 'Content-Type: Application/json' -XPUT 'http://localhost:9200/accounts' -d '{ + curl -sSH 'Content-Type: Application/json' -XPUT 'http://localhost:9200/accounts' -d '{ "mappings": { "_doc": { "dynamic": false, diff --git a/sbin/es-jobs-mapping.sh b/sbin/es-jobs-mapping.sh index 52517b9..5cb9b9c 100755 --- a/sbin/es-jobs-mapping.sh +++ b/sbin/es-jobs-mapping.sh @@ -28,14 +28,14 @@ then fi
# Determine whether jobs index has created -status_code=$(curl -sIL -w "%{http_code}\n" -o /dev/null http://localhost:9200/jobs) +status_code=$(curl -sSIL -w "%{http_code}\n" -o /dev/null http://localhost:9200/jobs)
if [ $status_code -eq 200 ] then echo "jobs index has create, exit." else echo "jobs index not exists, begin create index." - curl -H 'Content-Type: Application/json' -XPUT 'http://localhost:9200/jobs' -d '{ + curl -sSH 'Content-Type: Application/json' -XPUT 'http://localhost:9200/jobs' -d '{ "mappings": { "_doc": { "dynamic": false, @@ -164,7 +164,7 @@ else echo "create jobs index failed." else echo "set index.mapping.total_fields.limit: 10000" - curl -XPUT 127.0.0.1:9200/jobs/_settings -H 'Content-Type: application/json' \ + curl -sS -XPUT 127.0.0.1:9200/jobs/_settings -H 'Content-Type: application/json' \ -d '{"index.mapping.total_fields.limit": 10000}' fi fi diff --git a/sbin/es-regression-mapping.sh b/sbin/es-regression-mapping.sh index 7ef19cd..8e04bdb 100755 --- a/sbin/es-regression-mapping.sh +++ b/sbin/es-regression-mapping.sh @@ -1,14 +1,14 @@ #!/bin/sh
# check whether regression index has created -status_code=$(curl -sIL -w "%{http_code}\n" -o /dev/null http://localhost:9200/regression) +status_code=$(curl -sSIL -w "%{http_code}\n" -o /dev/null http://localhost:9200/regression)
if [ "$status_code" -eq 200 ] then echo "regression index has been created, exit." else echo "begin create index." - curl -H 'Content-Type: Application/json' -XPUT 'http://localhost:9200/regression' -d '{ + curl -sSH 'Content-Type: Application/json' -XPUT 'http://localhost:9200/regression' -d '{ "mappings": { "_doc": { "dynamic": false, diff --git a/sbin/es-repo-mapping.sh b/sbin/es-repo-mapping.sh index 4605051..17f0986 100755 --- a/sbin/es-repo-mapping.sh +++ b/sbin/es-repo-mapping.sh @@ -3,12 +3,12 @@ # Copyright (c) 2020 Huawei Technologies Co., Ltd. All rights reserved.
# Check if "repo" index already exists. -status_code=$(curl -sIL -w "%{http_code}\n" -o /dev/null http://localhost:9200/repo) +status_code=$(curl -sSIL -w "%{http_code}\n" -o /dev/null http://localhost:9200/repo) [ $status_code -eq 200 ] && echo '"repo" index already exists.' && exit
# Create "repo" index. echo 'Start to create "repo" index.' -curl -H 'Content-Type: Application/json' -XPUT 'http://localhost:9200/repo' -d ' +curl -sSH 'Content-Type: Application/json' -XPUT 'http://localhost:9200/repo' -d ' { "mappings": { "_doc": {