small-package/luci-app-packet-capture/root/usr/libexec/packet_capture_stop

10 lines
179 B
Plaintext
Raw Normal View History

2023-01-28 01:28:48 +08:00
#!/bin/sh
pid=$(cat /var/run/packet_capture.pid)
if [ -n "$pid" ] && grep -sq packet_capture "/proc/$pid/cmdline"; then
ppid=$(pgrep -P $pid)
kill -TERM $ppid
fi
exit 0