base-files: fix several bashisms

For equality test a simple = is sufficient, the == is
usually disregarded as bashism.

Signed-off-by: Michael Heimpold <mhei@heimpold.de>
This commit is contained in:
Michael Heimpold 2018-12-04 23:12:05 +01:00 committed by Hans Dedecker
parent 8ad45992ac
commit d6ac8ca76c
5 changed files with 5 additions and 5 deletions

View file

@ -82,7 +82,7 @@ fs_wait_for_key () {
failsafe_wait() { failsafe_wait() {
FAILSAFE= FAILSAFE=
[ "$pi_preinit_no_failsafe" == "y" ] && { [ "$pi_preinit_no_failsafe" = "y" ] && {
fs_wait_for_key "" "" $fs_failsafe_wait_timeout fs_wait_for_key "" "" $fs_failsafe_wait_timeout
return return
} }

View file

@ -18,7 +18,7 @@ do_urandom_seed() {
_do_urandom_seed "/etc/urandom.seed" _do_urandom_seed "/etc/urandom.seed"
SEED="$(uci -q get system.@system[0].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 boot_hook_add preinit_main do_urandom_seed

View file

@ -164,7 +164,7 @@ export_partdevice() {
} }
hex_le32_to_cpu() { 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}" echo "${1:0:2}${1:8:2}${1:6:2}${1:4:2}${1:2:2}"
return return
} }

View file

@ -13,7 +13,7 @@ save() {
} }
SEED="$(uci -q get system.@system[0].urandom_seed || true)" SEED="$(uci -q get system.@system[0].urandom_seed || true)"
[ "${SEED:0:1}" == "/" ] && save "$SEED" [ "${SEED:0:1}" = "/" ] && save "$SEED"
SEED=/etc/urandom.seed SEED=/etc/urandom.seed
[ ! -f $SEED ] && save "$SEED" [ ! -f $SEED ] && save "$SEED"

View file

@ -1,5 +1,5 @@
#!/bin/sh #!/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 exec /bin/login