From be942ccbbc067f70f43f591f7883fe3b3e1d5259 Mon Sep 17 00:00:00 2001 From: Minecon724 Date: Sun, 10 Aug 2025 11:02:56 +0200 Subject: [PATCH] Update usr/local/bin/pingfinder.sh --- usr/local/bin/pingfinder.sh | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/usr/local/bin/pingfinder.sh b/usr/local/bin/pingfinder.sh index a9f386c..300c6a0 100644 --- a/usr/local/bin/pingfinder.sh +++ b/usr/local/bin/pingfinder.sh @@ -14,12 +14,6 @@ UUID=${UUID} PEERFINDER=${PEERFINDER:-"https://dn42.us/peers"} NB_PINGS=${NB_PINGS:-5} -LOGFILE=${LOGFILE:-/dev/stdout} # Set to /dev/null to only receive errors. - # Set to a file writable by the cron runner to record pings. - # (Errors will be sent in cron mail) -WARNLOCK=${WARNLOCK:-warn.lock} # Set this variable if you want a file written when the script updates. -LOCKFILE=${LOCKFILE:-exec.lock} # Set this variable if you want the script to not run multiple instances at once. -LOCKFD=${LOCKFD:-42} # This avoids synchronisation (everybody fetching jobs and running # measurements simultaneously) @@ -33,18 +27,11 @@ function die() { exit 1 } -eval "exec $LOCKFD>$LOCKFILE" - -flock -n "$LOCKFD" || die "Unable to acquire lock." - VERSION=1.2.1 # shellcheck disable=SC2046 # Intended splitting of VERSION # shellcheck disable=SC2183 # ver() { printf "%03d%03d%03d%03d" $(echo "$1" | tr '.' ' '); } -[ -e "$LOGFILE" ] || touch "$LOGFILE" -exec >> "$LOGFILE" - echo "STARTING PEERFINDER (v. $VERSION)" # check for IPv4 binary @@ -69,20 +56,9 @@ while true ; do REQ_ID=$(grep REQ_ID "$JOB"|cut -d'=' -f2|tr -d '[$`;><{}%|&!()]"\\/') REQ_IP=$(grep REQ_IP "$JOB"|cut -d'=' -f2|tr -d '[$`;><{}%|&!()]"\\/') REQ_FAMILY=$(grep REQ_FAMILY "$JOB"|cut -d'=' -f2|tr -d '[$`;><{}%|&!()]"\\/') - CUR_VERSION=$(grep SCRIPT_VERSION "$JOB"|cut -d'=' -f2|tr -d '[$`;><{}%|&!()]"\\/') rm "$JOB" - if [ "$(ver "$VERSION")" -lt "$(ver "$CUR_VERSION")" ]; then - echo "## PEERFINDER WARN $(date) ## " \ - "Current script version is $CUR_VERSION. You are running $VERSION " \ - "Get it here: https://dn42.us/peers/script" - - [ -z "$WARNLOCK" ] && touch "$WARNLOCK" - else - [ -z "$WARNLOCK" ] || [ -f "$WARNLOCK" ] && rm "$WARNLOCK" - fi - # Avoid empty fields [ -z "$REQ_ID" ] && [ -z "$REQ_IP" ] && exit