[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [guardfraction/master] variable shuffling
commit 78192868b37958b8e7e6070cf78d2b402fd5e577
Author: Peter Palfrader <peter@xxxxxxxxxxxxx>
Date: Wed Feb 4 17:05:40 2015 +0100
variable shuffling
---
guardfraction_cron.sh | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/guardfraction_cron.sh b/guardfraction_cron.sh
index c7c72dd..d1539cf 100755
--- a/guardfraction_cron.sh
+++ b/guardfraction_cron.sh
@@ -13,24 +13,27 @@ set -e
GUARDFRACTION_SRC=$(dirname "$0")
GUARDFRACTION_SRC=$(readlink -f "$GUARDFRACTION_SRC")
-STATE_DIR="$GUARDFRACTION_SRC/var"
-WGET_PREFIX=""
-#WGET_PREFIX="torify"
+STATE_DIR="" # defaults to $GUARDFRACTION_SRC/var
+GUARDFRACTION_OUTPUT_FILE="" # defaults to :$STATE_DIR/guardfraction.output
+
+WGET_PREFIX="" # one option might be "torify"
CONSENSUS_SOURCE="http://128.31.0.39:9131/tor/status-vote/current/consensus"
+
DAYS_WORTH=90
-GUARDFRACTION_OUTPUT_FILE="" # defaults to :$STATE_DIR/guardfraction.output
-VERBOSE=${VERBOSE:0}
+
+VERBOSE=${VERBOSE:-0}
# You can override any of the above variables in ~/.guardfraction.conf
[ -e ~/.guardfraction.conf ] && . ~/.guardfraction.conf
+[ "$VERBOSE" -gt 1 ] && set -x
+
+STATE_DIR="${STATE_DIR:-$GUARDFRACTION_SRC/var}"
+GUARDFRACTION_OUTPUT_FILE="${GUARDFRACTION_OUTPUT_FILE:-$STATE_DIR/guardfraction.output}"
if ! [ -d "$STATE_DIR" ]; then
mkdir "$STATE_DIR"
fi
-# Where the guardfraction output file should be placed.
-GUARDFRACTION_OUTPUT_FILE="${GUARDFRACTION_OUTPUT_FILE:$STATE_DIR/guardfraction.output}"
-
# Use flock to avoid parallel runs of the script
exec 9< "$STATE_DIR"
if ! flock -n -e 9; then
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits