From 52fa235b7bd05ed620e2bfeb7e38bb92cc139193 Mon Sep 17 00:00:00 2001 From: Luis Guzman Date: Mon, 6 Jul 2020 15:37:02 -0500 Subject: [PATCH] Prevent sing up Make curl silent (cherry picked from commit 35bc407c34bc5dd8760bc42a70bc7aec43bb2e73) --- grafana.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/grafana.sh b/grafana.sh index 8e4c674..c4f6f1e 100644 --- a/grafana.sh +++ b/grafana.sh @@ -144,6 +144,7 @@ sed -i "s|;domain =.*|domain = $DOMAIN|" $GRAFANA_INI sed -i "s|;enforce_domain =.*|enforce_domain = false|" $GRAFANA_INI sed -i "s|;root_url =.*|root_url = http://$DOMAIN:3000/grafana/|" $GRAFANA_INI sed -i "s|;serve_from_sub_path =.*|serve_from_sub_path = true|" $GRAFANA_INI +sed -i "s|;allow_sign_up =.*|allow_sign_up = false|" $GRAFANA_INI systemctl restart grafana-server echo "Waiting for Grafana to load..." @@ -168,7 +169,7 @@ fi echo " # Setup Grafana credentials. " -curl -k -u "admin:admin" -X \ +curl -s -k -u "admin:admin" -X \ PUT -H "Content-Type: application/json;charset=UTF-8" -d \ "{ \"oldPassword\": \"admin\", @@ -179,7 +180,7 @@ PUT -H "Content-Type: application/json;charset=UTF-8" -d \ echo " # Create InfluxDB datasource " -curl -k -u "admin:$GRAFANA_PASS" -X \ +curl -s -k -u "admin:$GRAFANA_PASS" -X \ POST -H 'Content-Type: application/json;charset=UTF-8' -d \ '{ "name": "InfluxDB", @@ -200,7 +201,7 @@ ds=(11969); for d in "${ds[@]}"; do echo -n "Processing $d: " j=$(curl -s -k -u "$grafana_cred" $grafana_host/api/gnet/dashboards/$d | jq .json) - curl -k -u "$grafana_cred" -XPOST -H "Accept: application/json" \ + curl -s -k -u "$grafana_cred" -XPOST -H "Accept: application/json" \ -H "Content-Type: application/json" \ -d "{ \"dashboard\": $j,