diff --git a/src/chroot_script b/src/chroot_script index 99f7890b..491fadb6 100755 --- a/src/chroot_script +++ b/src/chroot_script @@ -212,6 +212,26 @@ echo "mapping wlan1" >> /etc/network/interfaces echo " script /root/bin/map_iface" >> /etc/network/interfaces echo "source /boot/octopi-network.txt" >> /etc/network/interfaces +# allow configuring multiple wifi networks via /boot/octopi-wpa-supplicant.txt +mv /etc/wpa_supplicant/wpa_supplicant.conf /boot/octopi-wpa-supplicant.txt +ln -s /boot/octopi-wpa-supplicant.txt /etc/wpa_supplicant/wpa_supplicant.conf +cat <> /etc/wpa_supplicant/wpa_supplicant.conf + +# This is only used to configure multiple wifi networks or other advanced wifi features. +# take a look into octopi-network.txt instead if you only need basic wifi configuration +# 'man -s 5 wpa_supplicant.conf' for advanced options +#network={ +# ssid="Your Wifi SSID" +# psk="supersecretwifipassword" +#} + +## You can configure more than 1 wifi networks by adding more 'network' blocks +#network={ +# ssid="Another Wifi" +# psk="password" +#} +EOT + # copy /etc/wpa_supplicant/ifupdown.sh to /etc/ifplugd/action.d/ifupdown - for wlan auto reconnect [ -f /etc/ifplugd/action.d/ifupdown ] && mv /etc/ifplugd/action.d/ifupdown /etc/ifplugd/action.d/ifupdown.original [ -f /etc/wpa_supplicant/ifupdown.sh ] && ln -s /etc/wpa_supplicant/ifupdown.sh /etc/ifplugd/action.d/ifupdown diff --git a/src/filesystem/boot/octopi-network.txt b/src/filesystem/boot/octopi-network.txt index 17343a35..2cb22c67 100644 --- a/src/filesystem/boot/octopi-network.txt +++ b/src/filesystem/boot/octopi-network.txt @@ -9,6 +9,8 @@ # # Just uncomment the lines prefixed with a single # of the configuration # that matches your wifi setup and fill in SSID and passphrase. +# +# If you need to configure more than 1 wifi networks, please use /boot/octopi-wpa-supplicant.txt instead ## WPA/WPA2 secured #iface wlan0-octopi inet manual