feat: compressor, more stastus verbosity, multiple ways to stop
This commit is contained in:
parent
8f61e0d37e
commit
617d9cc0fc
8 changed files with 195 additions and 36 deletions
|
|
@ -1,15 +1,21 @@
|
|||
#!/bin/bash
|
||||
|
||||
PIDFILE="${XDG_RUNTIME_DIR:-/tmp}/speechd.pid"
|
||||
|
||||
if [ -f "$PIDFILE" ]; then
|
||||
PID=$(cat "$PIDFILE")
|
||||
if kill -0 "$PID" 2>/dev/null; then
|
||||
kill -USR1 "$PID"
|
||||
else
|
||||
echo "Daemon not running (stale pidfile)" >&2
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
[ -f "$PIDFILE" ] || {
|
||||
echo "Daemon not running (no pidfile)" >&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
PID=$(cat "$PIDFILE")
|
||||
|
||||
kill -0 "$PID" 2>/dev/null || {
|
||||
echo "Daemon not running (stale pidfile)" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
"-n") kill -USR2 "$PID";;
|
||||
"-a") kill -ALRM "$PID";;
|
||||
*) kill -USR1 "$PID";;
|
||||
esac
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue