Dismiss Notice

Welcome To SNBForums

SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.

If you'd like to post a question, simply register and have at it!

While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!

Controlling Amazon dash button via postlease.sh

Discussion in 'Asuswrt-Merlin' started by fun4stuff, Dec 6, 2017.

  1. fun4stuff

    fun4stuff Occasional Visitor

    Joined:
    Feb 18, 2017
    Messages:
    30
    Ive been using an Amazon dash button to control smart led lights Via this postlease.sh script:

    #!/bin/sh
    logger "amazon script running"
    NowLeasedMac=$2
    if [ "$NowLeasedMac" == "xx:xx:xx:xx:xx:xx" ]; then
    wget "https://maker.ifttt.com/trigger/xxxx/with/key/xxxx"
    logger "amazon script triggered"
    fi
    #

    If I wanted to add another Amazon dash button to control a second light, how would I modify the script to do it? I tried the following but it didn't work.


    #!/bin/sh
    logger "amazon script running"
    NowLeasedMac=$2
    if [ "$NowLeasedMac" == "xx:xx:xx:xx:xx:xx" ]; then
    wget "https://maker.ifttt.com/trigger/xxxx/with/key/xxxx"
    logger "amazon script triggered"
    fi

    if [ "$NowLeasedMac" == "Aa:Aa:Aa:Aa:Aa:Aa" ]; then
    wget "https://maker.ifttt.com/trigger/xxxx/with/key/Aaaa"
    logger "amazon script 2 triggered"
    fi


    #



    What am I missing? thanks
     

Share This Page