scripts/wifi-off-delay: turn wifi off after 20 minutes regardless of connection

This is done so that a SCUHU users can see the pi IP address has connected to their hotspot without having to then log in via SSH to turn the wifi off before deployment.


Approved-by: David Sutton
This commit is contained in:
Trek Hopton 2023-10-20 06:25:10 +00:00
parent ba550e286a
commit d0cca977f5
1 changed files with 5 additions and 6 deletions

View File

@ -1,9 +1,8 @@
#!/bin/sh
#This script is intended to run at startup and will turn the wifi interface off if it has not connected to an SSID in 5 minutes.
# This script is intended to run at startup and will turn the wifi interface off after 20 minutes.
# If a user doesn't want the wifi to turn off, the service that controls this script can be
# disabled before the delay by running: "sudo service wifi-off-delay stop".
sleep 300
if iwconfig wlan0 | grep -q "ESSID:off/any"; then
sudo ifconfig wlan0 down
fi
sleep 1200
sudo ifconfig wlan0 down