HEX
Server: Apache
System: Linux opal14.opalstack.com 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
User: curbgloabal_opal (1234)
PHP: 8.1.29
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //etc/kernel/prerm.d/dkms
#!/bin/sh

# We're passed the version of the kernel being removed
inst_kern=$1

if command -v dkms > /dev/null; then
	dkms status -k "$inst_kern" 2>/dev/null | while IFS=",:/ " read -r name vers _ arch status; do
		[ "$status" = "installed" ] || continue
		echo "dkms: removing: $name $vers ($inst_kern) ($arch)" >&2
		dkms remove -m "$name" -v "$vers" -k "$inst_kern" -a "$arch"
	done
fi

rmdir --ignore-fail-on-non-empty \
	"/lib/modules/$inst_kern/updates/dkms" \
	"/lib/modules/$inst_kern/updates" 2>/dev/null

exit 0