base-files: fix several bashisms
authorMichael Heimpold <mhei@heimpold.de>
Tue, 4 Dec 2018 22:12:05 +0000 (23:12 +0100)
committerHans Dedecker <dedeckeh@gmail.com>
Wed, 5 Dec 2018 21:16:52 +0000 (22:16 +0100)
For equality test a simple = is sufficient, the == is
usually disregarded as bashism.

Signed-off-by: Michael Heimpold <mhei@heimpold.de>
package/base-files/files/lib/preinit/30_failsafe_wait
package/base-files/files/lib/preinit/81_urandom_seed
package/base-files/files/lib/upgrade/common.sh
package/base-files/files/sbin/urandom_seed
package/base-files/files/usr/libexec/login.sh

index 9a34f2de4cb39a890e5f34faa175a9e587d7a484..dd9c7e2b59449b5fa0c9944a1ec9cc703e30cbed 100644 (file)
@@ -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
        }
index 10878f3dc2d3167d8016e55f8f38f4dc146e99f1..26212c60b5e0f46f910367b8107161a587b6a701 100644 (file)
@@ -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
index 9e9144cba4e9bbe0d95b77b5b3bec716e1403fb0..8ee07494a38af524c017ec1ad9ae2b7a9b773f74 100644 (file)
@@ -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
        }
index 16d36574eb7ff5a35d0691ae2064d07a98fc9623..7043e8af4e6a282ef3fe94f16411219867a9d34c 100755 (executable)
@@ -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"
index 3c8bb509c02860d94c7a5c22c54ccb66334fa42b..1fff39c6a069e460dba75873218340e753ffaaff 100755 (executable)
@@ -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