Automatically launch wpa_cli on ttyE1

    

On my NetBSD system, the WPA connection seems to fail when wpa_cli is not running. So here’s how to start it automatically (and hiddenly) on the console.

Create the autologin script:

# cat > /root/wpa_cli  
#!/bin/sh  
#

/usr/pkg/bin/sudo /usr/sbin/wpa_cli  
exit 0  

# chmod 755 /root/wpa_cli

Create the autologin user:

# sudo useradd -u 2010 -g wheel -c "Automatic login" -s /root/wpa_cli al

Edit the /etc/gettytab file:

# Automatic login  
#  
al:  
:al=al:np:sp#9600:ig:ht:

Edit the /etc/ttys file:

ttyE1 "/usr/libexec/getty al" vt220 on secure

Reboot and watch wpa_cli being started on ttyE1.