ref: 700ffdbbe020d3b547282445f299fdfd1cab46f7
parent: 738c2a4659507ded3d87b13546cb21a6452490bb
author: Aaron Bieber <[email protected]>
date: Wed Jul 17 18:46:48 EDT 2024
whi: make ssid grabber dynamic
--- a/rc/whi.rc
+++ b/rc/whi.rc
@@ -1,7 +1,7 @@
#!/bin/rc
-# TODO: make this dynamic
-knowns=`{awk '$0 ~ /essid/ {split($3, a, "="); print a[2]}' /mnt/factotum/ctl}
+#knowns=`{awk '$0 ~ /essid/ {split($3, a, "="); print a[2]}' /mnt/factotum/ctl}
+knowns=`{awk 'match($0, /essid=.* /) {split(substr($0,RSTART+1,RLENGTH-1),a,"="); print a[2]}' /mnt/factotum/ctl}
ether=ether1
if(~ $#* 1)
ether=$1