-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup-networking-with-wifi-only
48 lines (36 loc) · 1.13 KB
/
setup-networking-with-wifi-only
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/sh
PROGRAM=setup-networking-with-wifi-only
VERSION=0.1
echo "Adding wpa_supplicant"
apk add wpa_supplicant
echo "Overwriting /etc/network/interfaces with custom configuration"
cat >/etc/network/interfaces <<-__EOF__
# alpine-user-conf: setup-networking-with-wifi-only
auto lo
iface lo inet loopback
auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
__EOF__
echo "Overwriting /etc/wpa_supplicant/wpa_supplicant.conf with custom configuration"
cat >/etc/wpa_supplicant/wpa_supplicant.conf <<-__EOF__
# alpine-user-conf: setup-networking-with-wifi-only
ctrl_interface=/run/wpa_supplicant
ctrl_interface_group=wheel
ap_scan=1
autoscan=period:3
disable_scan_offload=1
update_config=1
__EOF__
echo "Adding networking service to boot"
rc-update add networking boot
echo "Adding wpa_supplicant service to boot"
rc-update add wpa_supplicant boot
echo "Adding wpa_cli service to boot"
rc-update add wpa_cli boot
echo "Starting/Restarting wpa_suppliant service"
rc-service wpa_supplicant restart
echo "Starting/Restarting wpa_cli service"
rc-service wpa_cli restart
echo "Starting/Restarting networking service"
rc-service networking restart