burrow-pi-img/stage4/02-net-tweaks/01-run.sh

23 lines
679 B
Bash
Raw Normal View History

2016-04-11 06:29:41 +00:00
#!/bin/bash -e
2018-03-02 20:08:24 +00:00
install -v -d "${ROOTFS_DIR}/etc/systemd/system/dhcpcd.service.d"
install -v -m 644 files/wait.conf "${ROOTFS_DIR}/etc/systemd/system/dhcpcd.service.d/"
2016-04-11 06:29:41 +00:00
2018-03-02 20:08:24 +00:00
install -v -d "${ROOTFS_DIR}/etc/wpa_supplicant"
install -v -m 600 files/wpa_supplicant.conf "${ROOTFS_DIR}/etc/wpa_supplicant/"
2016-04-11 06:29:41 +00:00
# disable wireless
install -m 644 files/raspi-blacklist.conf "${ROOTFS_DIR}/etc/modprobe.d/"
2018-11-16 08:48:44 +00:00
if [ -v WPA_COUNTRY ]
then
echo "country=${WPA_COUNTRY}" >> "${ROOTFS_DIR}/etc/wpa_supplicant/wpa_supplicant.conf"
fi
if [ -v WPA_ESSID -a -v WPA_PASSWORD ]
then
on_chroot <<EOF
wpa_passphrase ${WPA_ESSID} ${WPA_PASSWORD} >> "/etc/wpa_supplicant/wpa_supplicant.conf"
EOF
fi