]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
base-files: profile: fix error sh: 1: unknown operand
authorFelix Nilsson <felixn@axis.com>
Wed, 12 Jun 2024 02:39:09 +0000 (04:39 +0200)
committerSteve Sakoman <steve@sakoman.com>
Wed, 12 Jun 2024 15:09:18 +0000 (08:09 -0700)
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>
meta/recipes-core/base-files/base-files/profile

index bded3757cc19411572a51a0282d377a8d12a202a..5e8393c91c6b4d1e4280f453d3d4b11e58115679 100644 (file)
@@ -58,7 +58,7 @@ resize() {
        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