Handle errors when SHLVL isn't set.
Signed-off-by: Felix Nilsson <felixn@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit
5df53fcfe3b70a5312fced3fcc1ba6290f2ee794)
Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
fi
# only do this for /dev/tty[A-z] which are typically
# serial ports
- if [ $FIRSTTIMESETUP -eq 1 -a $SHLVL -eq 1 ] ; then
+ if [ $FIRSTTIMESETUP -eq 1 -a ${SHLVL:-1} -eq 1 ] ; then
case $(tty 2>/dev/null) in
/dev/tty[A-z]*) resize >/dev/null;;
esac