#!/bin/sh

set -e

case "${1}" in
	install)

cat > /etc/modprobe.d/CVE-2026-46300.conf << EOF
# /etc/modprobe.d/CVE-2026-46300.conf

# Name: Fragnesia
# URL:  https://github.com/v12-security/pocs/tree/main/fragnesia

blacklist rxrpc
install rxrpc /bin/false
EOF

		rmmod rxrpc > /dev/null 2>&1 || true

		echo 3 > /proc/sys/vm/drop_caches
		;;

	remove)
		rm -f /etc/modprobe.d/CVE-2026-46300.conf
		;;
esac
