Created
March 3, 2025 12:11
-
-
Save manio/028c5ebc1e791430743b29f0a25021b5 to your computer and use it in GitHub Desktop.
sample script which is stopping/starting aawgd based on nearby WiFi network visibility
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# this is a sample script which is testing if there is available ESSID on the WiFi | |
# and according to the result it is starting/stopping aawgd | |
# more info: https://github.com/nisargjhaveri/WirelessAndroidAutoDongle/issues/212#issuecomment-2692423007 | |
delaytime=5 | |
essid="searchedAPName" | |
while [ true ]; do | |
wifiavail='iw dev wlan0 scan|grep SSID' | |
if echo "$wifiavail" | grep -q "$essid"; then | |
/etc/init.d/S93aawgd stop | |
else | |
/etc/init.d/S93aawgd start | |
fi | |
sleep $delaytime; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment