jasbur / RaspiWiFi

Headless WiFi configuration for the Raspberry Pi (or most other devices running Linux) by using a temporary WiFi access point and web interface
Other
613 stars 277 forks source link

Simplest way to detect if running in host mode or not? #118

Open benwiley4000 opened 2 years ago

benwiley4000 commented 2 years ago

I'm trying to configure another program to know when RaspiWiFi is in host/configuration mode or just running normally. Is there an easy way to do this?

jediempi commented 2 years ago

I use the IP address to check if it is in host/configuration mode. This is my easy script... :)

#!/bin/bash case $(ifconfig) in "inet 10.0.0.1") echo $inet "IP found in 10 range for AP mode, leaving DNS alone" ;; *) echo $inet "Not in AP mode anymore, let's call the next script" /bin/bash /home/pi/wifi_fix_dns.sh ;; esac`

jediempi commented 2 years ago

IMG_4051

benwiley4000 commented 2 years ago

Thank you! Super helpful.