You are not logged in.
Hello there ,
I'd like to write a script that allow me to connect my wifi with wpa_supplicant automatically when the computer boot.
I even have that script, but I usually launch it myself when I log in.
I have some issues doing this, that's why I ask for some help here !
I can use my .bash_profile to do it isn't it ?
Can't I do something like that ?
.bash_profile :
if [[ $wifi != 1 ]]
then
mywifiscript
wifi = 1
export wifi #I don't want this script to be executed each time i log me on other TTY
fi
thanks a lot for your answers !
(I hope I'm on the right section, and I'm not native english, sorry for your eyes !)
Offline
The best way to launch it would be to make a systemd service file.
The excerpt from your bash_profile will not work as intended. That will run every time the bash_profile is read on a new login. Exporting your 'wifi' variable only makes that variable available to child processes, not other logins.
However, I'm curious what's actually in your script. There is a wpa_supplicant service file already (I think), or if you just enable dhcpcd service, it will automatically start wpa_supplicant as needed.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Well have you tried it?
(Please use [ code ] … [ /code ] around your code.)
Personally I have a /etc/rc.local file to do that kind of stuff, but since systemd happened this functionnality has been removed (it was too easy and useful so "they" decided to remove it, I guess).
Also, why don’t you use netctl? Works mostly fine here.
Offline