mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-04 18:13:56 +08:00
This commit is contained in:
1 parent
c7bafc635d
commit
c71da84035
264 files changed
+8169
-3944
No files matched your search
@@ -1,9 +1,16 @@
|
||||
#!/bin/sh
|
||||
|
||||
pid=$(cat /var/run/packet_capture.pid)
|
||||
PIDFILE="/var/run/packet_capture.pid"
|
||||
|
||||
pid=$(cat "$PIDFILE" 2>/dev/null)
|
||||
case "$pid" in ''|*[!0-9]*) pid="" ;; esac
|
||||
if [ -n "$pid" ] && grep -sq packet_capture "/proc/$pid/cmdline"; then
|
||||
ppid=$(pgrep -P $pid)
|
||||
kill -TERM $ppid
|
||||
[ -n "$ppid" ] && kill -TERM $ppid
|
||||
else
|
||||
# Nothing runs it any more (the helper died on an error before removing
|
||||
# it): a stale pidfile made every later start answer "running".
|
||||
rm -f "$PIDFILE"
|
||||
fi
|
||||
|
||||
exit 0
|
||||
Reference in new issue
Block a user