@@ -13,6 +13,9 sed -i "s/^RaspberryPI/${HOSTNAME}/" "${ETC_DIR}/hostname" | |||||
13 | install_readonly files/network/hosts "${ETC_DIR}/hosts" |
|
13 | install_readonly files/network/hosts "${ETC_DIR}/hosts" | |
14 | sed -i "s/RaspberryPI/${HOSTNAME}/" "${ETC_DIR}/hosts" |
|
14 | sed -i "s/RaspberryPI/${HOSTNAME}/" "${ETC_DIR}/hosts" | |
15 |
|
15 | |||
|
16 | # Ensure /etc/systemd/network directory is available | |||
|
17 | mkdir -p "${ETC_DIR}/systemd/network" | |||
|
18 | ||||
16 | # Setup hostname entry with static IP |
|
19 | # Setup hostname entry with static IP | |
17 | if [ "$NET_ETH_ADDRESS" != "" ] ; then |
|
20 | if [ "$NET_ETH_ADDRESS" != "" ] ; then | |
18 | NET_IP=$(echo "${NET_ETH_ADDRESS}" | cut -f 1 -d'/') |
|
21 | NET_IP=$(echo "${NET_ETH_ADDRESS}" | cut -f 1 -d'/') | |
@@ -68,6 +71,7 fi | |||||
68 |
|
71 | |||
69 |
|
72 | |||
70 | if [ "$ENABLE_WIRELESS" = true ] ; then |
|
73 | if [ "$ENABLE_WIRELESS" = true ] ; then | |
|
74 | mkdir -p "${ETC_DIR}/wpa_supplicant" | |||
71 | if [ "$ENABLE_WIFI_DHCP" = true ] ; then |
|
75 | if [ "$ENABLE_WIFI_DHCP" = true ] ; then | |
72 | # Enable DHCP configuration for interface eth0 |
|
76 | # Enable DHCP configuration for interface eth0 | |
73 | sed -i -e "s/DHCP=.*/DHCP=yes/" -e "/DHCP/q" "${ETC_DIR}/systemd/network/wlan0.network" |
|
77 | sed -i -e "s/DHCP=.*/DHCP=yes/" -e "/DHCP/q" "${ETC_DIR}/systemd/network/wlan0.network" | |
@@ -97,16 +101,15 if [ "$ENABLE_WIRELESS" = true ] ; then | |||||
97 | if [ ! -z "$NET_WIFI_SSID" ] && [ ! -z "$NET_WIFI_PSK" ] ; then |
|
101 | if [ ! -z "$NET_WIFI_SSID" ] && [ ! -z "$NET_WIFI_PSK" ] ; then | |
98 | chroot_exec printf " |
|
102 | chroot_exec printf " | |
99 | ctrl_interface=/run/wpa_supplicant |
|
103 | ctrl_interface=/run/wpa_supplicant | |
100 | ctrl_interface_group=wheel |
|
|||
101 | update_config=1 |
|
104 | update_config=1 | |
102 | eapol_version=1 |
|
105 | eapol_version=1 | |
103 | ap_scan=1 |
|
106 | ap_scan=1 | |
104 | fast_reauth=1 |
|
107 | fast_reauth=1 | |
105 |
|
108 | |||
106 |
" > |
|
109 | " > "${ETC_DIR}/wpa_supplicant/wpa_supplicant-wlan0.conf" | |
107 |
|
110 | |||
108 | #Configure WPA_supplicant |
|
111 | #Configure WPA_supplicant | |
109 |
chroot_exec wpa_passphrase "$NET_SSID" "$NET_W |
|
112 | chroot_exec wpa_passphrase "$NET_WIFI_SSID" "$NET_WIFI_PSK" >> "${ETC_DIR}/wpa_supplicant/wpa_supplicant-wlan0.conf" | |
110 |
|
113 | |||
111 | chroot_exec systemctl enable wpa_supplicant.service |
|
114 | chroot_exec systemctl enable wpa_supplicant.service | |
112 | chroot_exec systemctl enable wpa_supplicant@wlan0.service |
|
115 | chroot_exec systemctl enable wpa_supplicant@wlan0.service |
General Comments 0
Vous devez vous connecter pour laisser un commentaire.
Se connecter maintenant