NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

detecting serial console from a shell-script



Hello

Is there a way to detect that nature of the console from a shell script?
I have an auto-install script that should perform differently whether
console is serial or BIOS. 

sysctl kern.consdev seems to give the answer. How reliable is it? Can I
take for granted that this command will detect a serial console?
/sbin/sysctl kern.consdev | egrep -q '= tty0[0-3]$' && echo "serial"

-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
manu%netbsd.org@localhost


Home | Main Index | Thread Index | Old Index