mirror of
https://github.com/usatiuk/dhfs.git
synced 2025-10-29 04:57:48 +01:00
add running check to update script
This commit is contained in:
@@ -5,6 +5,15 @@ set -o pipefail
|
|||||||
|
|
||||||
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
|
SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
|
||||||
|
|
||||||
|
PIDFILE="$SCRIPT_DIR"/.pid
|
||||||
|
|
||||||
|
if [ -f "$PIDFILE" ]; then
|
||||||
|
if kill -0 $(cat "$PIDFILE") >/dev/null; then
|
||||||
|
echo "Already running: "$(cat "$PIDFILE")
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# 💀
|
# 💀
|
||||||
LATEST=$(curl "https://api.github.com/repos/usatiuk/dhfs/actions/runs?branch=main&status=completed&per_page=1" | tr -d "[:space:]" | sed -n "s/.*\[{\"id\":\([0-9]*\).*/\1/p")
|
LATEST=$(curl "https://api.github.com/repos/usatiuk/dhfs/actions/runs?branch=main&status=completed&per_page=1" | tr -d "[:space:]" | sed -n "s/.*\[{\"id\":\([0-9]*\).*/\1/p")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user