diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2020-04-28 23:39:18 -0700 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2020-04-28 23:39:18 -0700 |
commit | 8f37aa42f6bef7baf73a4ecc0bc2caafd4e7e546 (patch) | |
tree | 396a9c3043fd90be63c768024b98200a46aa22c8 | |
parent | htdocs: throw in a shiny frontpage (diff) | |
download | gentoo-mirrorstats-8f37aa42f6bef7baf73a4ecc0bc2caafd4e7e546.tar.gz gentoo-mirrorstats-8f37aa42f6bef7baf73a4ecc0bc2caafd4e7e546.tar.bz2 gentoo-mirrorstats-8f37aa42f6bef7baf73a4ecc0bc2caafd4e7e546.zip |
wrapper: ensure locking
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
-rwxr-xr-x | mirmon-wrapper.sh | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/mirmon-wrapper.sh b/mirmon-wrapper.sh index 4c5570b..4fffee0 100755 --- a/mirmon-wrapper.sh +++ b/mirmon-wrapper.sh @@ -33,6 +33,8 @@ main() { CONFFILE=$(readlink -f "${CONFDIR}"/mirmon.conf) VAR_GMIRRORS=${VARDIR}/g.mirrors EXTRA_MIRRORS=${CONFDIR}/g.mirrors.extra + # Lock outselves + [ "${FLOCKER}" != "$0" ] && exec env FLOCKER="$0" flock -en "${VARDIR}/flock" "$0" "${OPTS[@]}" || : # Grab mirrors from the web mkdir -p "${VARDIR}" "${HTDOCS}" || die "Failed to mkdir" @@ -148,4 +150,5 @@ done [[ $INVALID -eq 1 ]] && usage [[ $HELP -eq 1 ]] && dohelp +OPTS=( ${opts} ) # for flock main |