Browse Source

fix: shellcheck for modules.d/95resume/module-setup.sh

master
Harald Hoyer 4 years ago committed by Harald Hoyer
parent
commit
9fb16311a4
  1. 13
      modules.d/95resume/module-setup.sh

13
modules.d/95resume/module-setup.sh

@ -5,7 +5,7 @@ check() { @@ -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() { @@ -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

Loading…
Cancel
Save