Change wifi a bit so that the file is generated for the image instead of just being copied over.

This commit is contained in:
Storm Dragon 2020-12-27 15:25:08 -05:00
parent 815c5f024d
commit c25f27e879
1 changed files with 3 additions and 3 deletions

View File

@ -93,7 +93,8 @@ done
# make sure variables are set, or use defaults.
if [[ -n "${imageWifi}" ]]; then
export imageWifi
export imageWifiESSID="$(grep 'ESSID=' "${imageWifi}" | cut -d = -f2)"
export imageWifiKey="$(grep 'Key=' "${imageWifi}" | cut -d = -f2)"
fi
export imageVersion="${imageVersion:-4}"
export imageSize="${imageSize:-8G}"
@ -147,7 +148,6 @@ wget "${url[$imageVersion]}" -O- | bsdtar -xpf - -C /mnt
# Set up wifi
if [[ -n "${imageWifi}" ]]; then
mkdir -v "/mnt/etc/netctl"
cp -v "${imageWifi}" "/mnt/etc/netctl"
fi
# Create Mycroft service file
cat << 'EOF' > /mnt/etc/systemd/system/mycroft.service
@ -223,7 +223,7 @@ echo mycroft > /etc/hostname
# Enable services
systemctl enable mycroft sshd
if [[ -n "${imageWifi}" ]]; then
netctl enable "${imageWifi##*/}"
netctl enable "mycroft"
fi
# Update fstab for Raspberry Pi 4.
#[[ $imageVersion -eq 4 ]] && sed -i 's/mmcblk0/mmcblk1/g' /etc/fstab