Skip to content

Commit 38b78ae

Browse files
authored
fix: enable WiFi per default on RPI SBCs (mainsail-crew#334)
1 parent 5093c55 commit 38b78ae

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

modules/raspberry/11-fix-wifi

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/bin/bash
2+
3+
# this module is based on the rasp-config
4+
5+
set -xe
6+
export LC_ALL=C
7+
8+
########################################
9+
# Functions and Basic Configuration #
10+
########################################
11+
12+
# Load common functions and set up cleanup trap
13+
source /common.sh
14+
install_cleanup_trap
15+
16+
# Load additional configuration (e.g., BASE_USER)
17+
source /files/00-config
18+
19+
########################################
20+
# Configuration #
21+
########################################
22+
23+
NM_STATE="/var/lib/NetworkManager/NetworkManager.state"
24+
25+
########################################
26+
# Unblock rfkill wifi #
27+
########################################
28+
29+
if hash rfkill 2> /dev/null; then
30+
rfkill unblock wifi
31+
fi
32+
33+
########################################
34+
# Fix Wireless State #
35+
########################################
36+
37+
if [[ -f "$NM_STATE" ]]; then
38+
sed -i 's/^WirelessEnabled=.*/WirelessEnabled=true/' "$NM_STATE"
39+
fi

0 commit comments

Comments
 (0)