mirror of
https://github.com/usatiuk/dhfs.git
synced 2025-10-29 04:57:48 +01:00
24 lines
354 B
Bash
Executable File
24 lines
354 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
|
|
|
|
PIDFILE="$SCRIPT_DIR"/.pid
|
|
|
|
if [ ! -f "$PIDFILE" ]; then
|
|
echo "Not running"
|
|
exit 2
|
|
fi
|
|
|
|
if ! kill -0 $(cat "$PIDFILE") >/dev/null; then
|
|
echo "Not running"
|
|
rm .pid
|
|
exit 2
|
|
fi
|
|
|
|
PID=$(cat "$PIDFILE")
|
|
|
|
echo "Killing $PID"
|
|
kill "$PID"
|
|
|
|
rm .pid
|