moga + fmt/clippy

This commit is contained in:
lda committed 2025-08-25 03:02:20 +07:00
1 parent ecbb1c653c
commit 0c10cc734a
13 files changed
+223 -66

No files matched your search

+25
View File
@@ -0,0 +1,25 @@
#!/bin/sh
# Kill wakey by PID quietly. Prefer pidof (BusyBox), fallback to ps/awk.
# 1) Try pidof
pids="$(pidof wakey 2>/dev/null)"
# 2) Fallback: ps | awk (avoid matching awk/grep themselves)
if [ -z "$pids" ]; then
pids="$(ps w 2>/dev/null | awk '/\/\.bin\/wakey/ && $0 !~ /awk/ {print $1}')"
fi
[ -n "$pids" ] || exit 0
# Send TERM first
kill -TERM $pids 2>/dev/null || true
# Optional: hard kill if still alive after a short grace
sleep 0.2
remain=""
for p in $pids; do
kill -0 "$p" 2>/dev/null && remain="$remain $p"
done
[ -z "$remain" ] || kill -KILL $remain 2>/dev/null || true
exit 0