Hi
My goal is to have a script that every 5 seconds checks rssi of a mac address, and if it increases from medium to strong, then sends me a message.
I have a similar script done to let me know if my wan ip has changed:
#!/bin/sh
#Pushover settings
pushover_token="secret" # Your access token here (https://pushover.net/api)
pushover_username="sci-class 4" # Pushover User ID (the user/group key (not e-mail address often referred to as USER_KEY)
OLD_IP=$(nvram get dick_old_ip)
#echo "<$OLD_IP>"
WROUTER_IP=$(ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}')
#echo "<$WROUTER_IP>"
pushover_message () {
curl -s \
--form-string "token=$pushover_token" \
--form-string "user=$pushover_username" \
--form-string "message=New IP=$WROUTER_IP Old=$OLD_IP" \
https://api.pushover.net/1/messages.json
}
if [ "$OLD_IP" != "$WROUTER_IP" ]; then
pushover_message
nvram set dick_old_ip=$WROUTER_IP
fi
#nvram set dick_old_ip="for test, destroy value to force update"
My problem:
I cannot read the rssi.
dick@AX88U:/tmp# wl rssi 5C:CF:7F:B4:FA7
wl: Not Found
dick@AX88U:/tmp#
The device is available to see using the web interface:
1) What am I doing wrong?
Bonus questions:
2) Do I need to use nvram to keep the old ip address? Or is it possible to use som "static" variables, like in C?
3) How do I construct a limiter to have no more than one message, or one message per hour?
4) How can I more easily copy the mac address from the web page? It is very difficult in the box shown above.
My device:
RT-AX88U 384.13
Last:
Thanks!
My goal is to have a script that every 5 seconds checks rssi of a mac address, and if it increases from medium to strong, then sends me a message.
I have a similar script done to let me know if my wan ip has changed:
#!/bin/sh
#Pushover settings
pushover_token="secret" # Your access token here (https://pushover.net/api)
pushover_username="sci-class 4" # Pushover User ID (the user/group key (not e-mail address often referred to as USER_KEY)
OLD_IP=$(nvram get dick_old_ip)
#echo "<$OLD_IP>"
WROUTER_IP=$(ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}')
#echo "<$WROUTER_IP>"
pushover_message () {
curl -s \
--form-string "token=$pushover_token" \
--form-string "user=$pushover_username" \
--form-string "message=New IP=$WROUTER_IP Old=$OLD_IP" \
https://api.pushover.net/1/messages.json
}
if [ "$OLD_IP" != "$WROUTER_IP" ]; then
pushover_message
nvram set dick_old_ip=$WROUTER_IP
fi
#nvram set dick_old_ip="for test, destroy value to force update"
My problem:
I cannot read the rssi.
dick@AX88U:/tmp# wl rssi 5C:CF:7F:B4:FA7
wl: Not Found
dick@AX88U:/tmp#
The device is available to see using the web interface:
1) What am I doing wrong?
Bonus questions:
2) Do I need to use nvram to keep the old ip address? Or is it possible to use som "static" variables, like in C?
3) How do I construct a limiter to have no more than one message, or one message per hour?
4) How can I more easily copy the mac address from the web page? It is very difficult in the box shown above.
My device:
RT-AX88U 384.13
Last:
Thanks!