simiple updater

This commit is contained in:
2024-07-11 22:05:41 +02:00
parent 97ecb72387
commit feaaf12732
4 changed files with 47 additions and 0 deletions

26
run-wrapper/stop Executable file
View File

@@ -0,0 +1,26 @@
#!/usr/bin/env bash
set -e
set -u
set -o pipefail
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