Yes, I know, but I wonder in the program function what lights the dot.Probably that it`s connected.
Does anyone know what signal lights up the dot in the red circle.
Handshake turns it off after (3 minutes).
View attachment 61874
I think it only monitor handshake timer. If > 3min (or missing) then it's offline. Use wg userspace tool to monitor this.What I mean is, is there any signal in the program that lights the point?
Anyone know where in the source code I can look?
Need this for my control script to monitor start/stop connect/disconnect in wiregaurd client.
wg show wgs1 latest-handshakes
wg show wgs1 latest-handshakes | grep $(nvram get wgs1_c1_pub) | awk '{print $2}'
echo $(($(date +%s)-$(wg show wgs1 latest-handshakes | grep $(nvram get wgs1_c1_pub) | awk '{print $2}')))
Thank you, I have used this until now:I think it only monitor handshake timer. If > 3min (or missing) then it's offline. Use wg userspace tool to monitor this.
Example in @Martineau Wireguard Manager addon (search for Handshake)
https://github.com/MartineauUK/wireguard/blob/main/wg_manager.sh
I.e
OrCode:wg show wgs1 latest-handshakes
OrCode:wg show wgs1 latest-handshakes | grep $(nvram get wgs1_c1_pub) | awk '{print $2}'
Code:echo $(($(date +%s)-$(wg show wgs1 latest-handshakes | grep $(nvram get wgs1_c1_pub) | awk '{print $2}')))
wg show wgs1 | grep handshake | cut -d ":" -f3 | cut -d ")" -f1
sure, it all depends on how you whish to retrieve things in your script. Im not sure the order always stay the same? perhaps it is?Thank you, I have used this until now:
Code:wg show wgs1 | grep handshake | cut -d ":" -f3 | cut -d ")" -f1
ClientNr=1
TimeSinceHandshake=$(($(date +%s)-$(wg show wgs1 latest-handshakes | grep $(nvram get wgs1_c"$ClientNr"_pub) | awk '{print $2}')))
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!