Improvements to wifi.

This commit is contained in:
Storm Dragon 2020-12-27 18:09:42 -05:00
parent c25f27e879
commit 615ee19f4d
1 changed files with 4 additions and 3 deletions

View File

@ -93,8 +93,7 @@ done
# make sure variables are set, or use defaults.
if [[ -n "${imageWifi}" ]]; then
export imageWifiESSID="$(grep 'ESSID=' "${imageWifi}" | cut -d = -f2)"
export imageWifiKey="$(grep 'Key=' "${imageWifi}" | cut -d = -f2)"
export imageWifi
fi
export imageVersion="${imageVersion:-4}"
export imageSize="${imageSize:-8G}"
@ -147,7 +146,9 @@ mounted=0
wget "${url[$imageVersion]}" -O- | bsdtar -xpf - -C /mnt
# Set up wifi
if [[ -n "${imageWifi}" ]]; then
mkdir -v "/mnt/etc/netctl"
mkdir -p "/mnt/etc/netctl"
cp -v "${imageWifi}" "/mnt/etc/netctl/mycroft"
sed -i "s/Interface=.*/Interface=wlan0/" "${imageWifi}" "/mnt/etc/netctl/mycroft"
fi
# Create Mycroft service file
cat << 'EOF' > /mnt/etc/systemd/system/mycroft.service