aboutsummaryrefslogtreecommitdiff
path: root/ishome
diff options
context:
space:
mode:
Diffstat (limited to 'ishome')
-rwxr-xr-xishome15
1 files changed, 15 insertions, 0 deletions
diff --git a/ishome b/ishome
new file mode 100755
index 0000000..f547039
--- /dev/null
+++ b/ishome
@@ -0,0 +1,15 @@
+#!/bin/env sh
+
+WIFIBSS="xx:xx:xx:xx:xx:xx"
+WIFISSID="HomeNet"
+
+set -e
+
+bss=$(iwctl station wlan0 show | grep "ConnectedBss" | awk '{print $2}')
+wifi=$(iwctl station wlan0 show | grep "Connected network" | awk '{print $3}')
+
+if [ "$bss" = "$WIFIBSS" ] && [ "$wifi" = "$WIFISSID" ]; then
+ exit 0
+else
+ exit 1
+fi