]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
fix: shellcheck 0.8.0
authorLaszlo Gombos <laszlo.gombos@gmail.com>
Mon, 21 Nov 2022 04:01:59 +0000 (04:01 +0000)
committerLaszlo Gombos <laszlo.gombos@gmail.com>
Fri, 30 Dec 2022 14:10:00 +0000 (09:10 -0500)
33 files changed:
dracut-functions.sh
dracut-init.sh
dracut.sh
modules.d/03modsign/module-setup.sh
modules.d/10i18n/console_init.sh
modules.d/35network-legacy/dhclient-script.sh
modules.d/35network-legacy/parse-bond.sh
modules.d/35network-legacy/parse-bridge.sh
modules.d/35network-legacy/parse-ip-opts.sh
modules.d/35network-legacy/parse-team.sh
modules.d/35network-legacy/parse-vlan.sh
modules.d/40network/net-lib.sh
modules.d/45url-lib/module-setup.sh
modules.d/45url-lib/url-lib.sh
modules.d/50plymouth/plymouth-populate-initrd.sh
modules.d/90crypt/crypt-lib.sh
modules.d/90crypt/parse-crypt.sh
modules.d/90dm/dm-shutdown.sh
modules.d/90dmraid/dmraid.sh
modules.d/90mdraid/md-shutdown.sh
modules.d/95lunmask/parse-lunmask.sh
modules.d/98dracut-systemd/rootfs-generator.sh
modules.d/98syslog/rsyslogd-start.sh
modules.d/98usrmount/mount-usr.sh
modules.d/99base/dracut-lib.sh
modules.d/99squash/module-setup.sh
test/TEST-20-NFS/server-init.sh
test/TEST-30-ISCSI/server-init.sh
test/TEST-35-ISCSI-MULTI/server-init.sh
test/TEST-40-NBD/server-init.sh
test/TEST-50-MULTINIC/server-init.sh
test/TEST-60-BONDBRIDGEVLANIFCFG/client-init.sh
test/TEST-60-BONDBRIDGEVLANIFCFG/server-init.sh

index 280e4e782373d94bf81d01b32ef20becbd2d9089..6e3807b23f59abb42e137f1e415053ca8c53bfda 100755 (executable)
@@ -712,7 +712,7 @@ fs_get_option() {
     while [ $# -gt 0 ]; do
         case $1 in
             $_option=*)
-                echo "${1#${_option}=}"
+                echo "${1#"${_option}"=}"
                 break
                 ;;
         esac
index 40b66f54f65ab090fa1911bb52529f52ef9c036f..9c9340cfc34462ef9133b018139dc9b4e3d8a0f9 100755 (executable)
@@ -573,7 +573,7 @@ inst_rules_wildcard() {
 # make sure that library links are correct and up to date
 build_ld_cache() {
     for f in "$dracutsysrootdir"/etc/ld.so.conf "$dracutsysrootdir"/etc/ld.so.conf.d/*; do
-        [[ -f $f ]] && inst_simple "${f#$dracutsysrootdir}"
+        [[ -f $f ]] && inst_simple "${f#"$dracutsysrootdir"}"
     done
     if ! $DRACUT_LDCONFIG -r "$initdir" -f /etc/ld.so.conf; then
         if [[ $EUID == 0 ]]; then
@@ -696,8 +696,8 @@ inst_libdir_file() {
         for _dir in $libdirs; do
             for _i in "$@"; do
                 for _f in "$dracutsysrootdir$_dir"/$_i; do
-                    [[ ${_f#$dracutsysrootdir} =~ $_pattern ]] || continue
-                    [[ -e $_f ]] && _files+=("${_f#$dracutsysrootdir}")
+                    [[ ${_f#"$dracutsysrootdir"} =~ $_pattern ]] || continue
+                    [[ -e $_f ]] && _files+=("${_f#"$dracutsysrootdir"}")
                 done
             done
         done
@@ -705,7 +705,7 @@ inst_libdir_file() {
         for _dir in $libdirs; do
             for _i in "$@"; do
                 for _f in "$dracutsysrootdir$_dir"/$_i; do
-                    [[ -e $_f ]] && _files+=("${_f#$dracutsysrootdir}")
+                    [[ -e $_f ]] && _files+=("${_f#"$dracutsysrootdir"}")
                 done
             done
         done
index bbb346970e0e0eeb439fe6db5419f7f4f1b39b64..901ed09e94356497240f5a0d342bce5f6149252c 100755 (executable)
--- a/dracut.sh
+++ b/dracut.sh
@@ -958,6 +958,7 @@ if [[ $regenerate_all == "yes" ]]; then
     for ((i = 0; i < len; i++)); do
         case ${dracut_args[$i]} in
             --regenerate-all | --parallel)
+                # shellcheck disable=SC2184
                 unset dracut_args["$i"]
                 ;;
         esac
@@ -999,7 +1000,7 @@ for i in $DRACUT_PATH; do
     if [ -L "$dracutsysrootdir$i" ]; then
         rl=$(readlink -f "$dracutsysrootdir$i")
     fi
-    rl="${rl#$dracutsysrootdir}"
+    rl="${rl#"$dracutsysrootdir"}"
     if [[ $NPATH != *:$rl* ]]; then
         NPATH+=":$rl"
     fi
@@ -2212,7 +2213,7 @@ for ((i = 0; i < ${#include_src[@]}; i++)); do
                 [[ -e $objectname || -L $objectname ]] || continue
                 if [[ -d $objectname ]] && [[ ! -L $objectname ]]; then
                     # objectname is a directory, let's compute the final directory name
-                    object_destdir=${destdir}/${objectname#$src/}
+                    object_destdir=${destdir}/${objectname#"$src"/}
                     if ! [[ -e $object_destdir ]]; then
                         # shellcheck disable=SC2174
                         mkdir -m 0755 -p "$object_destdir"
index 08fd3418b47aee1ffbae79625e72f9b8809c6bca..56e2bdb835457b3324d5eb2a963e490a9108d9c2 100755 (executable)
@@ -33,6 +33,6 @@ install() {
 
     for x in "$dracutsysrootdir"/lib/modules/keys/*; do
         [[ ${x} == "$dracutsysrootdir/lib/modules/keys/*" ]] && break
-        inst_simple "${x#$dracutsysrootdir}"
+        inst_simple "${x#"$dracutsysrootdir"}"
     done
 }
index 3fe3b673d58c58463eca0c39e4a22d99bcf36d8c..3ca0ac1d13d249ae6941f3a6f77e19c1923b310c 100755 (executable)
@@ -19,7 +19,7 @@ set_keyboard() {
 }
 
 set_terminal() {
-    local dev=$1
+    local dev="$1"
 
     if [ "${UNICODE}" = 1 ]; then
         printf '\033%%G' >&7
@@ -58,7 +58,7 @@ dev_close() {
 }
 
 dev_open() {
-    local dev=$1
+    local dev="$1"
 
     exec 6< "${dev}" \
         && exec 7>> "${dev}"
index 82fc7e2c2c8a81405dbf5dbfd9fa7d08c5c75929..240c0fad50017db5bb7db4db07a252b8b6c9a745 100755 (executable)
@@ -72,7 +72,7 @@ setup_interface() {
     fi
     # Note: hostname can be fqdn OR short hostname, so chop off any
     # trailing domain name and explicity add any domain if set.
-    [ -n "$hostname" ] && echo "echo ${hostname%.$domain}${domain:+.$domain} > /proc/sys/kernel/hostname" > /tmp/net."$netif".hostname
+    [ -n "$hostname" ] && echo "echo ${hostname%."$domain"}${domain:+.$domain} > /proc/sys/kernel/hostname" > /tmp/net."$netif".hostname
 }
 
 setup_interface6() {
@@ -105,7 +105,7 @@ setup_interface6() {
 
     # Note: hostname can be fqdn OR short hostname, so chop off any
     # trailing domain name and explicity add any domain if set.
-    [ -n "$hostname" ] && echo "echo ${hostname%.$domain}${domain:+.$domain} > /proc/sys/kernel/hostname" > /tmp/net."$netif".hostname
+    [ -n "$hostname" ] && echo "echo ${hostname%."$domain"}${domain:+.$domain} > /proc/sys/kernel/hostname" > /tmp/net."$netif".hostname
 }
 
 parse_option_121() {
index 86cd89ce692085f2515f1244c17aab959e5fb1b5..ba30a3bc7b2676a0209924573207cd5dca456941 100755 (executable)
@@ -15,7 +15,7 @@
 # We translate list of slaves to space-separated here to make it easier to loop over them in ifup
 # Ditto for bonding options
 parsebond() {
-    local v=${1}:
+    local v="${1}":
     set --
     while [ -n "$v" ]; do
         set -- "$@" "${v%%:*}"
index f15ce4707bbbc63f5d636773a0746691f2882bcd..caea1dad7a6d8e050a43838e68f64867ee40a06f 100755 (executable)
@@ -8,7 +8,7 @@
 #
 
 parsebridge() {
-    local v=${1}:
+    local v="${1}":
     set --
     while [ -n "$v" ]; do
         set -- "$@" "${v%%:*}"
index 19af8789653025ecdfbfcfc77f945274da45e9c0..6a90f2a1da8e0af2ac8fca3149fb00488dfbfec6 100755 (executable)
@@ -139,7 +139,7 @@ fi
 
 # This ensures that BOOTDEV is always first in IFACES
 if [ -n "$BOOTDEV" ] && [ -n "$IFACES" ]; then
-    IFACES="${IFACES%$BOOTDEV*} ${IFACES#*$BOOTDEV}"
+    IFACES="${IFACES%"$BOOTDEV"*} ${IFACES#*"$BOOTDEV"}"
     IFACES="$BOOTDEV $IFACES"
 fi
 
index 7b1801ba458b8ff7c48a92cf9fccc5f5e87fbd30..83badc9980a8a2355fa6b99a6704feaccb234e79 100755 (executable)
@@ -10,7 +10,7 @@
 #
 
 parseteam() {
-    local v=${1}:
+    local v="${1}":
     set --
     while [ -n "$v" ]; do
         set -- "$@" "${v%%:*}"
index 1570cd8124fd08ec7f1a2deae402364c0f0dec10..c23f83315aa850ab0fbbde474072770d5cc1587e 100755 (executable)
@@ -5,7 +5,7 @@
 #
 
 parsevlan() {
-    local v=${1}:
+    local v="${1}":
     set --
     while [ -n "$v" ]; do
         set -- "$@" "${v%%:*}"
index bc1ffcde96df967e195999ad134e0b2b0e843acd..43467e460700577625a3db0ce3e87e8bbcea7658 100755 (executable)
@@ -243,7 +243,7 @@ set_ifname() {
 
 # pxelinux provides macaddr '-' separated, but we need ':'
 fix_bootif() {
-    local macaddr=${1}
+    local macaddr="${1}"
     local IFS='-'
     # shellcheck disable=SC2086
     macaddr=$(printf '%s:' ${macaddr})
@@ -395,11 +395,11 @@ parse_iscsi_root() {
             iscsi_target_ip=${v#[[]}
             iscsi_target_ip=${iscsi_target_ip%%[]]*}
             # shellcheck disable=SC1087
-            v=${v#[[]$iscsi_target_ip[]]:}
+            v=${v#[[]"$iscsi_target_ip"[]]:}
             ;;
         *)
             iscsi_target_ip=${v%%[:]*}
-            v=${v#$iscsi_target_ip:}
+            v=${v#"$iscsi_target_ip":}
             ;;
     esac
 
@@ -467,7 +467,7 @@ parse_iscsi_root() {
 }
 
 ip_to_var() {
-    local v=${1}:
+    local v="${1}":
     local i
     set --
     while [ -n "$v" ]; do
@@ -476,7 +476,7 @@ ip_to_var() {
             i="${v%%\]:*}"
             i="${i##\[}"
             set -- "$@" "$i"
-            v=${v#\[$i\]:}
+            v=${v#\["$i"\]:}
         else
             set -- "$@" "${v%%:*}"
             v=${v#*:}
@@ -565,7 +565,7 @@ ip_to_var() {
 }
 
 route_to_var() {
-    local v=${1}:
+    local v="${1}":
     local i
     set --
     while [ -n "$v" ]; do
@@ -574,7 +574,7 @@ route_to_var() {
             i="${v%%\]:*}"
             i="${i##\[}"
             set -- "$@" "$i"
-            v=${v#\[$i\]:}
+            v=${v#\["$i"\]:}
         else
             set -- "$@" "${v%%:*}"
             v=${v#*:}
@@ -691,7 +691,7 @@ wait_for_route_ok() {
 
     while [ $cnt -lt $timeout ]; do
         li=$(ip route show)
-        [ -n "$li" ] && [ -z "${li##*$1*}" ] && return 0
+        [ -n "$li" ] && [ -z "${li##*"$1"*}" ] && return 0
         sleep 0.1
         cnt=$((cnt + 1))
     done
index afbedb34fc2318b097bac18ca3a70d0adb58c9d5..65da87ee8c4312c7291664df0895141661b0b589 100755 (executable)
@@ -45,7 +45,7 @@ install() {
     done
     if [[ $_found ]] && [[ -n $_crts ]]; then
         for _crt in $_crts; do
-            if ! inst "${_crt#$dracutsysrootdir}"; then
+            if ! inst "${_crt#"$dracutsysrootdir"}"; then
                 dwarn "Couldn't install '$_crt' SSL CA cert bundle; HTTPS might not work."
                 continue
             fi
@@ -78,7 +78,7 @@ install() {
                         # install everything in it
                         mkdir -p -- "${initdir}/${_p11root}"
                         if ! $DRACUT_CP -L -t "${initdir}/${_p11root}" "${dracutsysrootdir}${_p11root}"/*; then
-                            dwarn "Couldn't install from p11-kit trust dir '${_p11root#$dracutsysrootdir}'; HTTPS might not work."
+                            dwarn "Couldn't install from p11-kit trust dir '${_p11root#"$dracutsysrootdir"}'; HTTPS might not work."
                         fi
                     done
                 done
index b009fd097792a1d70aa4db21aac7038fb6542c70..2fd6951948a729cc99ebeaae56cb683326fdaa36 100755 (executable)
@@ -141,7 +141,7 @@ nfs_already_mounted() {
             if [ "$path" = "$p" ]; then
                 echo "$mnt"
             elif str_starts "$path" "$p"; then
-                echo "$mnt"/"${path#$p/}"
+                echo "$mnt"/"${path#"$p"/}"
             fi
         fi
     done < /proc/mounts
index 52baa210598d2a4988a71fc35b731b7fe3f57677..e36ed521d6beef8e1281f6c8ad9875a64b81dd5e 100755 (executable)
@@ -34,10 +34,10 @@ if [[ $hostonly ]]; then
 else
     for x in "$dracutsysrootdir"/usr/share/plymouth/themes/{text,details}/*; do
         [[ -f $x ]] || continue
-        THEME_DIR=$(dirname "${x#$dracutsysrootdir}")
+        THEME_DIR=$(dirname "${x#"$dracutsysrootdir"}")
         # shellcheck disable=SC2174
         mkdir -m 0755 -p "${initdir}/$THEME_DIR"
-        inst_multiple "${x#$dracutsysrootdir}"
+        inst_multiple "${x#"$dracutsysrootdir"}"
     done
     (
         cd "${initdir}"/usr/share/plymouth/themes || exit
index 7a88643ccae3006c36bacad9c28f68dc7a27bf97..f3ba20dcc79d7b7462cce7a6bc01d6acbb74ce6a 100755 (executable)
@@ -141,7 +141,7 @@ ask_for_password() {
 # example:
 # test_dev -f LABEL="nice label" /some/file1
 test_dev() {
-    local test_op=$1
+    local test_op="$1"
     local dev="$2"
     local f="$3"
     local ret=1
index 70e96444ab4db713f8f418e40ee7c4bbd1005b5c..e46e347ac5abd72212cb0e091fbd035d714de2f5 100755 (executable)
@@ -53,7 +53,7 @@ else
 
             uuid=${uuid##luks-}
             if luksname=$(_cryptgetargsname "$uuid="); then
-                luksname="${luksname#$uuid=}"
+                luksname="${luksname#"$uuid"=}"
             else
                 luksname="luks-$uuid"
             fi
@@ -93,7 +93,7 @@ else
 
             serialid=${serialid##luks-}
             if luksname=$(_cryptgetargsname "$serialid="); then
-                luksname="${luksname#$serialid=}"
+                luksname="${luksname#"$serialid"=}"
             else
                 luksname="luks-$serialid"
             fi
@@ -133,7 +133,7 @@ else
 
             luksid=${luksid##luks-}
             if luksname=$(_cryptgetargsname "$luksid="); then
-                luksname="${luksname#$luksid=}"
+                luksname="${luksname#"$luksid"=}"
             else
                 luksname="luks-$luksid"
             fi
index 6dbd61758c6af8e41dc6d39a9d9523e3d64b9a6f..bd7134a9ad2e0b6ea715a40fc8f6da32c55d9842 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 _remove_dm() {
-    local dev=$1
+    local dev="$1"
     local s
     local devname
 
@@ -26,7 +26,7 @@ _remove_dm() {
 
 _do_dm_shutdown() {
     local ret=0
-    local final=$1
+    local final="$1"
     local dev
 
     info "Disassembling device-mapper devices"
index d10f42aa8d0eaf0d2637131ee84baa59568109b1..b517320a367e34b15c9e8d8065e16bffaa932850 100755 (executable)
@@ -26,7 +26,7 @@ if [ -n "$DM_RAIDS" ] || getargbool 0 rd.auto; then
         # only activate specified DM RAIDS
         for r in $DM_RAIDS; do
             for s in $SETS; do
-                if [ "${s##$r}" != "$s" ]; then
+                if [ "${s##"$r"}" != "$s" ]; then
                     info "Activating $s"
                     dmraid -ay -i -p --rm_partitions "$s" 2>&1 | vinfo
                 fi
index 5562ddb4aa43235e996227012e4e41b239ead1e4..ca768a9cf92506a12cbd8b86fd47e09fab736362 100755 (executable)
@@ -2,7 +2,7 @@
 
 _do_md_shutdown() {
     local ret
-    local final=$1
+    local final="$1"
     info "Waiting for mdraid devices to be clean."
     mdadm -vv --wait-clean --scan | vinfo
     ret=$?
index 504c76d8637581408df27c37a7d3cf139df19d18..5e05e5bcc0fd6226009e427ce3f9127709a414dd 100755 (executable)
@@ -3,10 +3,10 @@
 # ex: ts=8 sw=4 sts=4 et filetype=sh
 
 create_udev_rule() {
-    local transport=$1
-    local tgtid=$2
-    local lun=$3
-    local _rule=/etc/udev/rules.d/51-${transport}-lunmask-${tgtid}.rules
+    local transport="$1"
+    local tgtid="$2"
+    local lun="$3"
+    local _rule=/etc/udev/rules.d/51-"${transport}"-lunmask-"${tgtid}".rules
 
     [ -e "${_rule}" ] && return 0
 
index e1d365df93798ea91e5fb5d98cc5fe4c06da2625..148c1cce7e57ddf9bb40cdc62e920b0f6bdcfeb1 100755 (executable)
@@ -44,8 +44,8 @@ EOF
 }
 
 generator_mount_rootfs() {
-    local _type=$2
-    local _flags=$3
+    local _type="$2"
+    local _flags="$3"
     local _name
 
     [ -z "$1" ] && return 0
index 1066893e94e8d2f54298d668abb8e595a90a2bb4..d404e51b3d2c4be3e4a7c84a09c88d27f970ccef 100755 (executable)
@@ -11,11 +11,11 @@ if [ -f /var/run/syslogd.pid ]; then
 fi
 
 rsyslog_config() {
-    local server=$1
+    local server="$1"
     shift
-    local syslog_template=$1
+    local syslog_template="$1"
     shift
-    local filters=$*
+    local filters="$*"
     local filter=
 
     cat "$syslog_template"
index 43ea0205f973e169313fdcf305f9a607fc6c7cdc..0a3eb324f50fc056fe180f83fcde212081cc3408 100755 (executable)
@@ -20,9 +20,9 @@ filtersubvol() {
 }
 
 fsck_usr() {
-    local _dev=$1
-    local _fs=$2
-    local _fsopts=$3
+    local _dev="$1"
+    local _fs="$2"
+    local _fsopts="$3"
     local _fsckoptions
 
     if [ -f "$NEWROOT"/fsckoptions ]; then
index 6963a19bd48e71fecabeca69db753cc0db6ca34b..218cb13b911fbd6c0ca5e71222844477a73c7f17 100755 (executable)
@@ -36,6 +36,7 @@ strstr() {
 # An empty $1 will not be considered matched, even if $2 is * which technically
 # matches; as it would match anything, it's not an interesting case.
 strglob() {
+    # shellcheck disable=SC2295
     [ -n "$1" -a -z "${1##$2}" ]
 }
 
@@ -43,6 +44,7 @@ strglob() {
 # An empty $1 will not be considered matched, even if $2 is * which technically
 # matches; as it would match anything, it's not an interesting case.
 strglobin() {
+    # shellcheck disable=SC2295
     [ -n "$1" -a -z "${1##*$2*}" ]
 }
 
@@ -323,7 +325,7 @@ getoptcomma() {
 
     case "${line}" in
         *,${opt}=*,*)
-            tmp="${line#*,${opt}=}"
+            tmp="${line#*,"${opt}"=}"
             echo "${tmp%%,*}"
             return 0
             ;;
@@ -353,10 +355,10 @@ splitsep() {
     local tmp
 
     while [ -n "$str" -a "$#" -gt 1 ]; do
-        tmp="${str%%$sep*}"
+        tmp="${str%%"$sep"*}"
         eval "$1='${tmp}'"
         str="${str#"$tmp"}"
-        str="${str#$sep}"
+        str="${str#"$sep"}"
         shift
     done
     [ -n "$str" -a -n "$1" ] && eval "$1='$str'"
@@ -471,8 +473,8 @@ check_occurances() {
     local expected="$3"
     local count=0
 
-    while [ "${str#*$ch}" != "${str}" ]; do
-        str="${str#*$ch}"
+    while [ "${str#*"$ch"}" != "${str}" ]; do
+        str="${str#*"$ch"}"
         count=$((count + 1))
     done
 
@@ -827,7 +829,7 @@ killproc() {
     debug_off
     local _exe
     _exe="$(command -v "$1")"
-    local _sig=$2
+    local _sig="$2"
     local _i
     [ -x "$_exe" ] || return 1
     for _i in /proc/[0-9]*; do
@@ -891,7 +893,7 @@ if ! command -v pidof > /dev/null 2> /dev/null; then
                 [ "$i" -ef "$_exe" ] || continue
             else
                 _rl=$(readlink -f "$i")
-                [ "${_rl%/$_cmd}" != "$_rl" ] || continue
+                [ "${_rl%/"$_cmd"}" != "$_rl" ] || continue
             fi
             i=${i%/exe}
             echo "${i##/proc/}"
index 81311d3a842b57a37f810629c4d8977a67f7f587..dc2e0a2059e3f2e22e4fe8db13dc22176b924ea9 100755 (executable)
@@ -30,7 +30,7 @@ installpost() {
     # so dracut rebuild and lsinitrd can work
     for file in "$squash_dir"/usr/lib/dracut/*; do
         [[ -f $file ]] || continue
-        DRACUT_RESOLVE_DEPS=1 dracutsysrootdir="$squash_dir" inst "${file#$squash_dir}"
+        DRACUT_RESOLVE_DEPS=1 dracutsysrootdir="$squash_dir" inst "${file#"$squash_dir"}"
     done
 
     # Install required modules and binaries for the squash image init script.
index 743f1d3e77f14af00314515c875ff7c78ab9649e..6abe82662a6246d5e129d51217cf5279a73bcf7d 100755 (executable)
@@ -37,7 +37,7 @@ wait_for_route_ok() {
     local cnt=0
     while [ $cnt -lt 200 ]; do
         li=$(ip route show)
-        [ -n "$li" ] && [ -z "${li##*$1*}" ] && return 0
+        [ -n "$li" ] && [ -z "${li##*"$1"*}" ] && return 0
         sleep 0.1
         cnt=$((cnt + 1))
     done
index fd5538d860f7810a4eb06ea60342ed00515e3630..a1c3b7ee90c15b80d9f6a08d3a9e5a0d2499972e 100755 (executable)
@@ -36,7 +36,7 @@ wait_for_route_ok() {
     local cnt=0
     while [ $cnt -lt 200 ]; do
         li=$(ip route show)
-        [ -n "$li" ] && [ -z "${li##*$1*}" ] && return 0
+        [ -n "$li" ] && [ -z "${li##*"$1"*}" ] && return 0
         sleep 0.1
         cnt=$((cnt + 1))
     done
index fd5538d860f7810a4eb06ea60342ed00515e3630..a1c3b7ee90c15b80d9f6a08d3a9e5a0d2499972e 100755 (executable)
@@ -36,7 +36,7 @@ wait_for_route_ok() {
     local cnt=0
     while [ $cnt -lt 200 ]; do
         li=$(ip route show)
-        [ -n "$li" ] && [ -z "${li##*$1*}" ] && return 0
+        [ -n "$li" ] && [ -z "${li##*"$1"*}" ] && return 0
         sleep 0.1
         cnt=$((cnt + 1))
     done
index 729d6a80406fb2b4fb45780d7261952396b0e1f8..bc52b2e662aa08ac588af8008eb25ae4e6995ac9 100755 (executable)
@@ -36,7 +36,7 @@ wait_for_route_ok() {
     local cnt=0
     while [ $cnt -lt 200 ]; do
         li=$(ip route show)
-        [ -n "$li" ] && [ -z "${li##*$1*}" ] && return 0
+        [ -n "$li" ] && [ -z "${li##*"$1"*}" ] && return 0
         sleep 0.1
         cnt=$((cnt + 1))
     done
index 7dcb256622b87694affafc1b35cf78998deb0840..91db7ae765c01568129add9e560682ca0c0b723c 100755 (executable)
@@ -37,7 +37,7 @@ wait_for_route_ok() {
     local cnt=0
     while [ $cnt -lt 200 ]; do
         li=$(ip route show)
-        [ -n "$li" ] && [ -z "${li##*$1*}" ] && return 0
+        [ -n "$li" ] && [ -z "${li##*"$1"*}" ] && return 0
         sleep 0.1
         cnt=$((cnt + 1))
     done
index 644308d1340928b22aea6f5bd0ed1fa23b2de605..b0851116ca5b49d60a50797616bfd33cd7debc2b 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 exec > /dev/console 2>&1
 export PATH=/usr/sbin:/usr/bin:/sbin:/bin
-strstr() { [ "${1#*$2*}" != "$1" ]; }
+strstr() { [ "${1#*"$2"*}" != "$1" ]; }
 CMDLINE=$(while read -r line; do echo "$line"; done < /proc/cmdline)
 export TERM=linux
 export PS1='initramfs-test:\w\$ '
index ea06b787e0a29f8108ffdb7576196d37e3787ad3..c125d0f4a34f77c1793337098f20c1939c266979 100755 (executable)
@@ -39,7 +39,7 @@ wait_for_route_ok() {
     local cnt=0
     while [ $cnt -lt 200 ]; do
         li=$(ip route show)
-        [ -n "$li" ] && [ -z "${li##*$1*}" ] && return 0
+        [ -n "$li" ] && [ -z "${li##*"$1"*}" ] && return 0
         sleep 0.1
         cnt=$((cnt + 1))
     done