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() {
swap_on_netdevice() { swap_on_netdevice() {
local _dev local _dev
for _dev in "${swap_devs[@]}"; do for _dev in "${swap_devs[@]}"; do
block_is_netdevice $_dev && return 0 block_is_netdevice "$_dev" && return 0
done done
return 1 return 1
} }
@ -33,25 +33,26 @@ cmdline() {
# called by dracut # called by dracut
install() { install() {
local _bin local _bin
local _resumeconf


if [[ $hostonly_cmdline == "yes" ]]; then if [[ $hostonly_cmdline == "yes" ]]; then
local _resumeconf=$(cmdline) _resumeconf=$(cmdline)
[[ $_resumeconf ]] && printf "%s\n" "$_resumeconf" >> "${initdir}/etc/cmdline.d/95resume.conf" [[ $_resumeconf ]] && printf "%s\n" "$_resumeconf" >> "${initdir}/etc/cmdline.d/95resume.conf"
fi fi


# if systemd is included and has the hibernate-resume tool, use it and nothing else # 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 if dracut_module_included "systemd" && [[ -x $dracutsysrootdir$systemdutildir/systemd-hibernate-resume ]]; then
inst_multiple -o \ inst_multiple -o \
$systemdutildir/system-generators/systemd-hibernate-resume-generator \ "$systemdutildir"/system-generators/systemd-hibernate-resume-generator \
$systemdsystemunitdir/systemd-hibernate-resume@.service \ "$systemdsystemunitdir"/systemd-hibernate-resume@.service \
$systemdutildir/systemd-hibernate-resume "$systemdutildir"/systemd-hibernate-resume
return 0 return 0
fi fi


# Optional uswsusp support # Optional uswsusp support
for _bin in /usr/sbin/resume /usr/lib/suspend/resume /usr/lib/uswsusp/resume for _bin in /usr/sbin/resume /usr/lib/suspend/resume /usr/lib/uswsusp/resume
do do
[[ -x "$dracutsysrootdir${_bin}" ]] && { [[ -x $dracutsysrootdir${_bin} ]] && {
inst "${_bin}" /usr/sbin/resume inst "${_bin}" /usr/sbin/resume
[[ $hostonly ]] && [[ -f $dracutsysrootdir/etc/suspend.conf ]] && inst -H /etc/suspend.conf [[ $hostonly ]] && [[ -f $dracutsysrootdir/etc/suspend.conf ]] && inst -H /etc/suspend.conf
break break

Loading…
Cancel
Save