Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support wpa_supplicant.conf.txt, convert DOS line endings to UNIX to keep wpa_supplicant happy #4

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
Open
1 change: 1 addition & 0 deletions debian/raspberrypi-net-mods.install
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
etc
usr
4 changes: 2 additions & 2 deletions debian/raspberrypi-net-mods.service
Original file line number Diff line number Diff line change
@@ -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/rpnm.sh
This conversation was marked as resolved.
Show resolved Hide resolved
ExecStartPost=/bin/chmod 600 /etc/wpa_supplicant/wpa_supplicant.conf
ExecStartPost=/usr/sbin/rfkill unblock wifi

Expand Down
10 changes: 10 additions & 0 deletions usr/lib/raspberrypi-net-mods/rpnm.sh
Original file line number Diff line number Diff line change
@@ -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 -7 /etc/wpa_supplicant.conf