fi
# save old tty number
tty=$(/usr/bin/tty)
- tty=${tty#$devpath}
- if [ "$tty" = "/dev/console" ]; then
+ if [ "$?" -ne 0 -o "$tty" = "/dev/console" ]; then
tty=1
+ else
+ tty=${tty#$devpath}
fi
if [ -n "$CONSOLEFONT" -a -x /sbin/setsysfont ]; then