Commit 5e495c0c authored by k.elaammari's avatar k.elaammari
Browse files

TODO line encoding crlf

parent 6cb76f35
......@@ -34,10 +34,12 @@ apitoken="${temp#\"}"
# Datasource
# copy the key and replace line breakes with '\n'
key="$(awk '$1=$1' ORS='\n' $cacertpath)"
# copy the key and remove \r if unix
#key="$(awk '$1=$1' ORS='\n' $cacertpath)"
key="$(sed -e 's/.$/\r/' $cacertpath)"
# set correct tlsCACert to verify signing
json="$(jq --arg value "$key" '.secureJsonData.tlsCACert = $value' $provision/config/datasources/ds_influx.json)"
echo "$json"
curl -X POST https://localhost:3000/api/datasources -H "Accept: application/json" -H "Content-Type: application/json" -H "Authorization: Bearer $apitoken" --data "$json" --cacert $cacertpath 2> /dev/null
echo "Grafana datasources influx. "
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment