]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
fix: shellcheck for modules.d/95resume/module-setup.sh
authorHarald Hoyer <harald@redhat.com>
Fri, 12 Feb 2021 12:26:13 +0000 (13:26 +0100)
committerHarald Hoyer <harald@hoyer.xyz>
Mon, 15 Feb 2021 10:00:37 +0000 (11:00 +0100)
modules.d/95resume/module-setup.sh

index 96c2573e11301879c20aa5314a2c363847e6ac56..551e589afbdaf94b5413acca9dbd74f0fad573c5 100755 (executable)
@@ -5,7 +5,7 @@ check() {
     swap_on_netdevice() {
         local _dev
         for _dev in "${swap_devs[@]}"; do
-            block_is_netdevice $_dev && return 0
+            block_is_netdevice "$_dev" && return 0
         done
         return 1
     }
@@ -33,25 +33,26 @@ cmdline() {
 # called by dracut
 install() {
     local _bin
+       local _resumeconf
 
     if [[ $hostonly_cmdline == "yes" ]]; then
-       local _resumeconf=$(cmdline)
+       _resumeconf=$(cmdline)
        [[ $_resumeconf ]] && printf "%s\n" "$_resumeconf" >> "${initdir}/etc/cmdline.d/95resume.conf"
     fi
 
     # if systemd is included and has the hibernate-resume tool, use it and nothing else
     if dracut_module_included "systemd" && [[ -x $dracutsysrootdir$systemdutildir/systemd-hibernate-resume ]]; then
         inst_multiple -o \
-                      $systemdutildir/system-generators/systemd-hibernate-resume-generator \
-                      $systemdsystemunitdir/systemd-hibernate-resume@.service \
-                      $systemdutildir/systemd-hibernate-resume
+                      "$systemdutildir"/system-generators/systemd-hibernate-resume-generator \
+                      "$systemdsystemunitdir"/systemd-hibernate-resume@.service \
+                      "$systemdutildir"/systemd-hibernate-resume
         return 0
     fi
 
     # Optional uswsusp support
     for _bin in /usr/sbin/resume /usr/lib/suspend/resume /usr/lib/uswsusp/resume
     do
-        [[ -x "$dracutsysrootdir${_bin}" ]] && {
+        [[ -x $dracutsysrootdir${_bin} ]] && {
             inst "${_bin}" /usr/sbin/resume
             [[ $hostonly ]] && [[ -f $dracutsysrootdir/etc/suspend.conf ]] && inst -H /etc/suspend.conf
             break