]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
base-files: profile: fix error sh: 1: unknown operand
authorFelix Nilsson <felixn@axis.com>
Mon, 20 May 2024 08:29:28 +0000 (10:29 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 22 May 2024 09:20:08 +0000 (10:20 +0100)
Handle errors when SHLVL isn't set.

Signed-off-by: Felix Nilsson <felixn@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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