From 7902311c570edd4286ba36f0cb85223d1e909a03 Mon Sep 17 00:00:00 2001 From: Patrick Schleizer Date: Sat, 7 Dec 2024 04:54:47 -0500 Subject: [PATCH] do not create /etc/sysctl.d/30-lkrg-virtualbox.conf if LKRG is not installed --- usr/share/security-misc/lkrg/lkrg-virtualbox | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/usr/share/security-misc/lkrg/lkrg-virtualbox b/usr/share/security-misc/lkrg/lkrg-virtualbox index 6ab093a..3e5edc3 100755 --- a/usr/share/security-misc/lkrg/lkrg-virtualbox +++ b/usr/share/security-misc/lkrg/lkrg-virtualbox @@ -6,6 +6,9 @@ #set -x set -e +## provides function: pkg_installed +source /usr/libexec/helper-scripts/package_installed_check.bsh + ## Check if the VirtualBox host software is installed. if ! command -v vboxmanage &>/dev/null ; then ## VirtualBox host software is not installed. @@ -24,7 +27,9 @@ if ! test -f /usr/share/security-misc/lkrg/30-lkrg-virtualbox.conf ; then exit 0 fi -## TODO: check if lkrg is installed. +if ! pkg_installed "lkrg" ; then + exit 0 +fi ## Delete using '--verbose' so user is notified. cp --verbose /usr/share/security-misc/lkrg/30-lkrg-virtualbox.conf /etc/sysctl.d/30-lkrg-virtualbox.conf