#!/bin/sh -euC
#Copyright: 2026 Aitor <aitor@genuen.org>
#License: CC0-1.0
PIDOF=$(pidof nl_monitor | cut -d ' ' -f 1)
[ -n "$PIDOF" ] || exit 0
PSTAT_BINARY=$(echo `pstat $PIDOF | grep PSTAT_BINARY=` | awk -F'"' '{ print $2 }')
ldd $PSTAT_BINARY | grep libnetaid.so.* >/dev/null || exit 1
exec /bin/kill -s SIGTERM $PIDOF
