test if serial port is found in dmesg output
authorDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 18 May 2009 08:26:23 +0000 (08:26 +0000)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Mon, 18 May 2009 08:26:23 +0000 (08:26 +0000)
git-svn-id: svn://svn.rot13.org/sysadmin-cookbook@87 191e9f34-6774-4a6d-acfc-7664dacd4a2a

recepies/amt/serial-console.sh

index 94d642b..c3b429b 100755 (executable)
@@ -4,6 +4,8 @@
 
 ttyS=`dmesg | grep ttyS | grep 0xe | sed 's/^.*\(ttyS[0-9]\).*$/\1/'`
 
+test -z "$ttyS" && echo "Can't find serial port in dmesg output" && exit
+
 if ! grep ttyS1 /etc/inittab | grep -v ^# ; then
        echo "Am:2345:respawn:/sbin/getty $ttyS 115200 vt100-nav" >> /etc/inittab
        init q