From: Michael Heimpold Date: Tue, 4 Dec 2018 22:12:05 +0000 (+0100) Subject: base-files: fix several bashisms X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=d6ac8ca76c04ed39d7dd5de73d3b921819934186;p=openwrt%2Fstaging%2Fdedeckeh.git base-files: fix several bashisms For equality test a simple = is sufficient, the == is usually disregarded as bashism. Signed-off-by: Michael Heimpold --- diff --git a/package/base-files/files/lib/preinit/30_failsafe_wait b/package/base-files/files/lib/preinit/30_failsafe_wait index 9a34f2de4c..dd9c7e2b59 100644 --- a/package/base-files/files/lib/preinit/30_failsafe_wait +++ b/package/base-files/files/lib/preinit/30_failsafe_wait @@ -82,7 +82,7 @@ fs_wait_for_key () { failsafe_wait() { FAILSAFE= - [ "$pi_preinit_no_failsafe" == "y" ] && { + [ "$pi_preinit_no_failsafe" = "y" ] && { fs_wait_for_key "" "" $fs_failsafe_wait_timeout return } diff --git a/package/base-files/files/lib/preinit/81_urandom_seed b/package/base-files/files/lib/preinit/81_urandom_seed index 10878f3dc2..26212c60b5 100644 --- a/package/base-files/files/lib/preinit/81_urandom_seed +++ b/package/base-files/files/lib/preinit/81_urandom_seed @@ -18,7 +18,7 @@ do_urandom_seed() { _do_urandom_seed "/etc/urandom.seed" SEED="$(uci -q get system.@system[0].urandom_seed)" - [ "${SEED:0:1}" == "/" -a "$SEED" != "/etc/urandom.seed" ] && _do_urandom_seed "$SEED" + [ "${SEED:0:1}" = "/" -a "$SEED" != "/etc/urandom.seed" ] && _do_urandom_seed "$SEED" } boot_hook_add preinit_main do_urandom_seed diff --git a/package/base-files/files/lib/upgrade/common.sh b/package/base-files/files/lib/upgrade/common.sh index 9e9144cba4..8ee07494a3 100644 --- a/package/base-files/files/lib/upgrade/common.sh +++ b/package/base-files/files/lib/upgrade/common.sh @@ -164,7 +164,7 @@ export_partdevice() { } hex_le32_to_cpu() { - [ "$(echo 01 | hexdump -v -n 2 -e '/2 "%x"')" == "3031" ] && { + [ "$(echo 01 | hexdump -v -n 2 -e '/2 "%x"')" = "3031" ] && { echo "${1:0:2}${1:8:2}${1:6:2}${1:4:2}${1:2:2}" return } diff --git a/package/base-files/files/sbin/urandom_seed b/package/base-files/files/sbin/urandom_seed index 16d36574eb..7043e8af4e 100755 --- a/package/base-files/files/sbin/urandom_seed +++ b/package/base-files/files/sbin/urandom_seed @@ -13,7 +13,7 @@ save() { } SEED="$(uci -q get system.@system[0].urandom_seed || true)" -[ "${SEED:0:1}" == "/" ] && save "$SEED" +[ "${SEED:0:1}" = "/" ] && save "$SEED" SEED=/etc/urandom.seed [ ! -f $SEED ] && save "$SEED" diff --git a/package/base-files/files/usr/libexec/login.sh b/package/base-files/files/usr/libexec/login.sh index 3c8bb509c0..1fff39c6a0 100755 --- a/package/base-files/files/usr/libexec/login.sh +++ b/package/base-files/files/usr/libexec/login.sh @@ -1,5 +1,5 @@ #!/bin/sh -[ "$(uci -q get system.@system[0].ttylogin)" == 1 ] || exec /bin/ash --login +[ "$(uci -q get system.@system[0].ttylogin)" = 1 ] || exec /bin/ash --login exec /bin/login