i'm new to shelling in linux.
i'm trying to write a shell script that uses a REST method and creates some datasources on grafana
i need the url to be modular and to be taken from an argument. this is the line i'm trying to run:
srv_url = "1.1.1.1:8080"
RESULT=$(/bin/curl --user admin:admin 'http://localhost:3000/api/datasources' -X POST -H 'Content-Type: application/json;charset=UTF-8' --data-binary '{"name":"Events","isDefault":false ,"type":"influxdb","url":"http://$srv_url","access":"proxy","basicAuth":false}')
as you can see i'm trying to plant the variable $srv_url inside ("url":"http://$srv_url"), but it will not take its value, whatever i tried the script uses its literal name, and not its value.
any ideas?
thanks.