Browse Source

refactor: check() in systemd modules

Refactoring require_binaries in check() for systemd modules
master
Jóhann B. Guðmundsson 4 years ago committed by Harald Hoyer
parent
commit
2f217abdb3
  1. 6
      modules.d/01systemd-ask-password/module-setup.sh
  2. 6
      modules.d/01systemd-coredump/module-setup.sh
  3. 6
      modules.d/01systemd-hostnamed/module-setup.sh
  4. 6
      modules.d/01systemd-resolved/module-setup.sh
  5. 6
      modules.d/01systemd-timesyncd/module-setup.sh

6
modules.d/01systemd-ask-password/module-setup.sh

@ -6,8 +6,10 @@
check() { check() {


# If the binary(s) requirements are not fulfilled the module can't be installed # If the binary(s) requirements are not fulfilled the module can't be installed
require_binaries systemd-ask-password || return 1 require_binaries \
require_binaries systemd-tty-ask-password-agent || return 1 systemd-ask-password \
systemd-tty-ask-password-agent \
|| return 1


# Return 255 to only include the module, if another module requires it. # Return 255 to only include the module, if another module requires it.
return 255 return 255

6
modules.d/01systemd-coredump/module-setup.sh

@ -6,8 +6,10 @@
check() { check() {


# If the binary(s) requirements are not fulfilled the module can't be installed # If the binary(s) requirements are not fulfilled the module can't be installed
require_binaries coredumpctl || return 1 require_binaries \
require_binaries "$systemdutildir"/systemd-coredump || return 1 coredumpctl \
"$systemdutildir"/systemd-coredump \
|| return 1


# Return 255 to only include the module, if another module requires it. # Return 255 to only include the module, if another module requires it.
return 255 return 255

6
modules.d/01systemd-hostnamed/module-setup.sh

@ -6,8 +6,10 @@
check() { check() {


# If the binary(s) requirements are not fulfilled the module can't be installed. # If the binary(s) requirements are not fulfilled the module can't be installed.
require_binaries hostnamectl || return 1 require_binaries \
require_binaries "$systemdutildir"/systemd-hostnamed || return 1 hostnamectl \
"$systemdutildir"/systemd-hostnamed \
|| return 1


# Return 255 to only include the module, if another module requires it. # Return 255 to only include the module, if another module requires it.
return 255 return 255

6
modules.d/01systemd-resolved/module-setup.sh

@ -6,8 +6,10 @@
check() { check() {


# If the binary(s) requirements are not fulfilled the module can't be installed # If the binary(s) requirements are not fulfilled the module can't be installed
require_binaries resolvectl || return 1 require_binaries \
require_binaries "$systemdutildir"/systemd-resolved || return 1 resolvectl \
"$systemdutildir"/systemd-resolved \
|| return 1


# Return 255 to only include the module, if another module requires it. # Return 255 to only include the module, if another module requires it.
return 255 return 255

6
modules.d/01systemd-timesyncd/module-setup.sh

@ -6,8 +6,10 @@
check() { check() {


# If the binary(s) requirements are not fulfilled the module can't be installed # If the binary(s) requirements are not fulfilled the module can't be installed
require_binaries "$systemdutildir"/systemd-timesyncd || return 1 require_binaries \
require_binaries "$systemdutildir"/systemd-time-wait-sync || return 1 "$systemdutildir"/systemd-timesyncd \
"$systemdutildir"/systemd-time-wait-sync \
|| return 1


# Return 255 to only include the module, if another module requires it. # Return 255 to only include the module, if another module requires it.
return 255 return 255

Loading…
Cancel
Save