diff --git a/debian/control b/debian/control index c7c0f0f..503ec75 100644 --- a/debian/control +++ b/debian/control @@ -7,5 +7,5 @@ Standards-Version: 4.3.0 Package: raspberrypi-net-mods Architecture: all -Depends: ${misc:Depends}, dhcpcd5 (>= 6.10.1-1+rpi2) +Depends: ${misc:Depends}, dhcpcd5 (>= 6.10.1-1+rpi2), dos2unix Description: Network configuration for the Raspberry Pi UI diff --git a/debian/raspberrypi-net-mods.install b/debian/raspberrypi-net-mods.install index ee19d5d..a75e237 100644 --- a/debian/raspberrypi-net-mods.install +++ b/debian/raspberrypi-net-mods.install @@ -1 +1,2 @@ etc +usr diff --git a/debian/raspberrypi-net-mods.service b/debian/raspberrypi-net-mods.service index 596403f..b60e348 100644 --- a/debian/raspberrypi-net-mods.service +++ b/debian/raspberrypi-net-mods.service @@ -1,13 +1,13 @@ [Unit] Description=Copy user wpa_supplicant.conf -ConditionPathExists=/boot/wpa_supplicant.conf +ConditionPathExistsGlob=/boot/wpa_supplicant.conf{,.txt} Before=dhcpcd.service After=systemd-rfkill.service [Service] Type=oneshot RemainAfterExit=yes -ExecStart=/bin/mv /boot/wpa_supplicant.conf /etc/wpa_supplicant/wpa_supplicant.conf +ExecStart=/usr/lib/raspberrypi-net-mods/mv-wpa.sh ExecStartPost=/bin/chmod 600 /etc/wpa_supplicant/wpa_supplicant.conf ExecStartPost=/usr/sbin/rfkill unblock wifi diff --git a/usr/lib/raspberrypi-net-mods/mv-wpa.sh b/usr/lib/raspberrypi-net-mods/mv-wpa.sh new file mode 100755 index 0000000..80fdacc --- /dev/null +++ b/usr/lib/raspberrypi-net-mods/mv-wpa.sh @@ -0,0 +1,10 @@ +#!/bin/sh +if [ -f "/boot/wpa_supplicant.conf" ]; then + /bin/mv /boot/wpa_supplicant.conf /etc/wpa_supplicant/wpa_supplicant.conf + if [ -f "/boot/wpa_supplicant.conf.txt" ]; then + /bin/rm /boot/wpa_supplicant.conf.txt + fi +elif [ -f "/boot/wpa_supplicant.conf.txt" ]; then + /bin/mv /boot/wpa_supplicant.conf.txt /etc/wpa_supplicant/wpa_supplicant.conf +fi +dos2unix /etc/wpa_supplicant/wpa_supplicant.conf