File tree Expand file tree Collapse file tree
overlay/lower/etc/network/if-pre-up.d Expand file tree Collapse file tree Load diff This file was deleted.
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+
3+ # only work on a WLAN interface
4+ if [ " wlan0" != " $IFACE " ]; then
5+ exit 0
6+ fi
7+
8+ . /usr/share/common
9+
10+ wlan0_missing () {
11+ ! test -f /etc/network/interfaces.d/wlan0
12+ }
13+
14+ wlan0_disabled () {
15+ ! grep -q ' ^auto wlan0' /etc/network/interfaces.d/wlan0 > /dev/null
16+ }
17+
18+ wlan0_no_ssid () {
19+ ! grep -q ' ssid=' /etc/wpa_supplicant.conf > /dev/null
20+ }
21+
22+ wlan0_no_pass () {
23+ ! grep -q ' psk=' /etc/wpa_supplicant.conf > /dev/null
24+ }
25+
26+ # exit 1 to stop the interface from being brought up, and dhcp being attempted
27+ if wlan0_missing; then
28+ echo_error " WLAN interface not configured"
29+ exit 1
30+ elif wlan0_disabled ; then
31+ echo_error " WLAN manually disabled"
32+ exit 1
33+ elif wlan0_no_ssid; then
34+ echo_error " WLAN disabled, no SSID"
35+ exit 1
36+ elif wlan0_no_pass; then
37+ echo_error " WLAN disabled, no password"
38+ exit 1
39+ fi
40+
41+ exit 0
Original file line number Diff line number Diff line change @@ -185,6 +185,8 @@ define WIFI_INSTALL_TARGET_CMDS
185185 # Captive Portal
186186 $(INSTALL ) -D -m 0644 $(WIFI_PKGDIR ) /files/wpa_supplicant.conf \
187187 $(TARGET_DIR ) /etc/wpa_supplicant.conf
188+ $(INSTALL ) -D -m 0755 $(WIFI_PKGDIR ) /files/disable_wlan \
189+ $(TARGET_DIR ) /etc/network/if-pre-up.d/disable_wlan
188190 $(INSTALL ) -D -m 0644 $(WIFI_PKGDIR ) /files/dnsd-portal.conf \
189191 $(TARGET_DIR ) /etc/dnsd-portal.conf
190192 $(INSTALL ) -D -m 0644 $(WIFI_PKGDIR ) /files/httpd-portal.conf \
You can’t perform that action at this time.
0 commit comments