Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- #log location, specific a diff location and file name as desired
- log=/jffs/etc/config/amazon-dash-dnsmasq.log
- #Put your dash button MAC Address here. Letters should be in lower case!
- #If you have less than 5 dash buttons, delete unnecessary lines
- DASH1=xx:xx:xx:xx:xx:xx
- DASH2=xx:xx:xx:xx:xx:xx
- DASH3=xx:xx:xx:xx:xx:xx
- DASH4=xx:xx:xx:xx:xx:xx
- DASH5=xx:xx:xx:xx:xx:xx
- #This script is passed a parameter value of either 'add', 'del', or 'old'
- #We do not want to trigger any events when the device is disconnected or removed, only when its added or re-triggered
- if [ $1 = "del" ]; then
- exit
- else
- elif [ $2 = $DASH1 -a $1 != 'del' ]; then
- # Command to run when the button is hit
- curl -k -X POST https://maker.ifttt.com/trigger/<YOUR_EVENT_#1>/with/key/<YOURKEY>
- date>>$log
- echo "DNSMASQ - Dash #1 found" >> $log
- echo "Param1 = $1" >> $log
- echo "Param2 = $2" >> $log
- elif [ $2 = $DASH2 -a $1 != 'del' ]; then
- # Command to run when the button is hit
- curl -k -X POST https://maker.ifttt.com/trigger/<YOUR_EVENT_#2>/with/key/<YOURKEY>
- date>>$log
- echo "DNSMASQ - Dash #2 found" >> $log
- echo "Param1 = $1" >> $log
- echo "Param2 = $2" >> $log
- elif [ $2 = $DASH3 -a $1 != 'del' ]; then
- # Command to run when the button is hit
- curl -k -X POST https://maker.ifttt.com/trigger/<YOUR_EVENT_#3>/with/key/<YOURKEY>
- date>>$log
- echo "DNSMASQ - DASH #3 found" >> $log
- echo "Param1 = $1" >> $log
- echo "Param2 = $2" >> $log
- elif [ $2 = $DASH4 -a $1 != 'del' ]; then
- # Command to run when the button is hit
- curl -k -X POST https://maker.ifttt.com/trigger/<YOUR_EVENT_#4>/with/key/<YOURKEY>
- date>>$log
- echo "DNSMASQ - DASH #4 found" >> $log
- echo "Param1 = $1" >> $log
- echo "Param2 = $2" >> $log
- elif [ $2 = $DASH5 -a $1 != 'del' ]; then
- # Command to run when the button is hit
- curl -k -X POST https://maker.ifttt.com/trigger/<YOUR_EVENT_#5>/with/key/<YOURKEY>
- date>>$log
- echo "DNSMASQ - DASH #5 found" >> $log
- echo "Param1 = $1" >> $log
- echo "Param2 = $2" >> $log
- else
- exit
- fi
- #kill any other processes that might exist
- killall -q amazon-dash-dnsmasq
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement