Skip to content

Commit

Permalink
installer: code improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
FooDeas committed Aug 15, 2023
1 parent 4f0a78f commit d2f5cca
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scripts/opt/raspberrypi-ua-netinst/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1943,7 +1943,7 @@ if [ "${use_systemd_services}" != "0" ]; then
if [ "${ip_addr}" = "dhcp" ]; then
echo "DHCP=yes" >> ${NETFILE}
else
NETPREFIX=$(/bin/busybox ipcalc -p ${ip_addr} ${ip_netmask} | cut -f2 -d=)
NETPREFIX=$(/bin/busybox ipcalc -p "${ip_addr}" "${ip_netmask}" | cut -f2 -d=)
{
echo "Address=${ip_addr}/${NETPREFIX}"
for i in ${ip_nameservers}; do
Expand All @@ -1968,11 +1968,11 @@ if [ "${use_systemd_services}" != "0" ]; then
if [ -e "${wlan_configfile}" ]; then
# copy the installer version of `wpa_supplicant.conf`
mkdir -p /rootfs/etc/wpa_supplicant
cp "${wlan_configfile}" /rootfs/etc/wpa_supplicant/wpa_supplicant-${ifname}.conf
chmod 600 /rootfs/etc/wpa_supplicant/wpa_supplicant-${ifname}.conf
cp "${wlan_configfile}" "/rootfs/etc/wpa_supplicant/wpa_supplicant-${ifname}.conf"
chmod 600 "/rootfs/etc/wpa_supplicant/wpa_supplicant-${ifname}.conf"
fi
# enable wpa_supplicant service
ln -s /lib/systemd/system/[email protected] /rootfs/etc/systemd/system/multi-user.target.wants/wpa_supplicant@${ifname}.service
ln -s /lib/systemd/system/[email protected] "/rootfs/etc/systemd/system/multi-user.target.wants/wpa_supplicant@${ifname}.service"
rm /rootfs/etc/systemd/system/multi-user.target.wants/wpa_supplicant.service
fi

Expand Down

0 comments on commit d2f5cca

Please sign in to comment.