Curl bash
Posted: Tuesday 13 August 2019 20:29
I have a Raspberry Pi with a motion sensor which when its tripped should visit the domoticz api to notify that it has been tripped.
I would like to visit this api via a shellscript.
This is what i came up with:
This results is Domoticz telling me something is wrong - ERR.
When i run the curl command from the commandline (without the VAR1 parameter), everything is working fine..
Could somebody pleasy help me, i have been searching for hours and i cant find the solution.
I think it has something to do with the variables in the URL (e.g. &idx=3)
I would like to visit this api via a shellscript.
This is what i came up with:
Code: Select all
#!/bin/bash
VAR1=$(curl -v "http://192.168.1.9:8084/json.htm?type=command¶m=switchLight&idx=3&switchcmd=On");
echo $VAR1;
exit 0
When i run the curl command from the commandline (without the VAR1 parameter), everything is working fine..
Could somebody pleasy help me, i have been searching for hours and i cant find the solution.
I think it has something to do with the variables in the URL (e.g. &idx=3)