Duncan Krebbers
New Around Here
I'm trying to intercept a click on Amazon Dash buttons to execute a script in my home automation controller, but I can't seem to get the jffs-part of it to work.
I followed the short guide from here, like this:
I've created two files on my computer
dnsmasq.conf.add
post-lease.sh
I followed the short guide from here, like this:
I've created two files on my computer
dnsmasq.conf.add
Code:
dhcp-script=/jffs/a/post-lease.sh
post-lease.sh
Code:
#!/bin/sh
touch /tmp/000wanstarted
NowLeasedMac=$2
# vitaminwater
if["$NowLeasedMac" == "mac-address1"]; then
wget "http://myip:3480/data_request?id=lu_action&output_format=xml&DeviceNum=28&serviceId=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=1"
echo "Caught Dash 1!"
fi
# starbucks doubleshot
if["$NowLeasedMac" == "mac-address2"]; then
wget "http://myip:3480/data_request?id=lu_action&output_format=xml&DeviceNum=28&serviceId=urn:upnp-org:serviceId:SwitchPower1&action=SetTarget&newTargetValue=0"
echo "Caught Dash 2!"
fi
#
- I've enabled JFFS scripts and configs in the router and enabled SSH.
- Then, I connected via WinSCP and transferred the dnsmasq-file to /jffs/configs and gave it chmod 0777
- I created a jffs/a directory where I placed the post-lease.sh file, also with chmod 0777
- I've rebooted the router and pressed the dash-buttons but nothing happens. The log shows no sign of it and the /tmp/ folder is not created. The dash-buttons are showing in the client-list when I press them.