From 9fb16311a4a2ba34f95371dbc43ab831a903d283 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 12 Feb 2021 13:26:13 +0100 Subject: [PATCH] fix: shellcheck for modules.d/95resume/module-setup.sh --- modules.d/95resume/module-setup.sh | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/modules.d/95resume/module-setup.sh b/modules.d/95resume/module-setup.sh index 96c2573e..551e589a 100755 --- a/modules.d/95resume/module-setup.sh +++ b/modules.d/95resume/module-setup.sh @@ -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