WebReflection / archibold.io

archibold.io
ISC License
86 stars 14 forks source link

possible bug on wifi profile creation #15

Closed ubidefeo closed 4 years ago

ubidefeo commented 4 years ago

As I mentioned to @WebReflection when I started using BENJA I have had no success in connecting to any of my WiFi networks using the wifi-setup script. I noticed that a request for password comes up but it disappears after a bit and if you make it in time to type it in you get authentication failure

This evening I had some extra time to play with configuring WiFi manually and it worked. I began looking at the script and going through what it does. At line 8 we have root | su -c "wifi-menu" so I went straight to executing "wifi-menu" with sudo

[~]$ sudo wifi-menu

this managed to create a profile for my network which I was later able to load using netctl [~]$ netctl enable my-profile-name

so I guess the issue is in how these two bits of code deal with authenticating root, namely these two blocks:

...
sleep 3
echo root | su -c "wifi-menu"
echo "
trying to configure the wifi automatically
"
...
...
echo root | su -c "netctl enable ${WLAN:2}"
echo "wifi ${WLAN:2} enabled"
echo ""
...

any chance you can find a fix? I'm not that versed in bash, although I have to admit I am becoming more and more familiar with it thanks to this project :D

thank you ubi

WebReflection commented 4 years ago

The wifi-setup is supposed to be launched as soon as you install BENJA, and it works for Pi0 and all others (Pi3 with WiFi or Pi4).

As the sudo command might be there but it's likely not configured at first boot, I'm not sure how to solve this, but I might try looking for wheel group in /etc/sudoers and eventually use sudo if already configured.

Would that work?

ubidefeo commented 4 years ago

which user is that script launched under? probably looking at sudoers might do the trick, but as you might imagine I'm just guessing :)

WebReflection commented 4 years ago

alarm, the BENJA setup is done on alarm