Skip to content
This repository has been archived by the owner on Jul 3, 2019. It is now read-only.

Commit

Permalink
scripts/wireguard: Only allow one execution at a time, with others fa…
Browse files Browse the repository at this point in the history
…iling open

Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
  • Loading branch information
zx2c4 authored and nathanchance committed Jun 26, 2018
1 parent e18d5ba commit cc531cc
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions scripts/fetch-latest-wireguard.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 ]]
Expand Down

0 comments on commit cc531cc

Please sign in to comment.