From fc2661f08a3ef08edec7704339577cc5c8c962e7 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Tue, 26 Jun 2018 00:59:25 +0200 Subject: patch-kernel: only allow one execution at a time, with others failing open --- fetch.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fetch.sh b/fetch.sh index dcc25de..4b00f43 100644 --- a/fetch.sh +++ b/fetch.sh @@ -2,6 +2,9 @@ set -e USER_AGENT="WireGuard-AndroidROMBuild/0.1 ($(uname -a))" +exec 9>.wireguard-fetch-lock +flock -n 9 || exit 0 + [[ $(( $(date +%s) - $(stat -c %Y "net/wireguard/.check" 2>/dev/null || echo 0) )) -gt 86400 ]] || exit 0 [[ $(curl -A "$USER_AGENT" -LSs https://git.zx2c4.com/WireGuard/refs/) =~ snapshot/WireGuard-([0-9.]+)\.tar\.xz ]] -- cgit v1.3-18-gd494