Change wifi a bit so that the file is generated for the image instead of just being copied over.
This commit is contained in:
parent
815c5f024d
commit
c25f27e879
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user