do not create /etc/sysctl.d/30-lkrg-virtualbox.conf if LKRG is not installed

This commit is contained in:
Patrick Schleizer 2024-12-07 04:54:47 -05:00
parent 1ce37d42cd
commit 7902311c57
No known key found for this signature in database
GPG Key ID: CB8D50BB77BB3C48

View File

@ -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