[tor-commits] [guardfraction/master] Make things configurable in a config file
asn at torproject.org
asn at torproject.org
Tue Feb 24 13:45:03 UTC 2015
commit bc15be307b9fa06880feb42a1176a607ed4dfba5
Author: Peter Palfrader <peter at palfrader.org>
Date: Wed Feb 4 17:01:26 2015 +0100
Make things configurable in a config file
---
guardfraction_cron.sh | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/guardfraction_cron.sh b/guardfraction_cron.sh
index cd6debc..60d0f01 100755
--- a/guardfraction_cron.sh
+++ b/guardfraction_cron.sh
@@ -17,15 +17,19 @@ STATE_DIR="$GUARDFRACTION_SRC/var"
WGET_PREFIX=""
#WGET_PREFIX="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=0
+
+# You can override any of the above variables in ~/.guardfraction.conf
+[ -e ~/.guardfraction.conf ] && . ~/.guardfraction.conf
if ! [ -d "$STATE_DIR" ]; then
mkdir "$STATE_DIR"
fi
# Where the guardfraction output file should be placed.
-GUARDFRACTION_OUTPUT_FILE="$STATE_DIR/guardfraction.output"
+GUARDFRACTION_OUTPUT_FILE="${GUARDFRACTION_OUTPUT_FILE:$STATE_DIR/guardfraction.output}"
# Use flock to avoid parallel runs of the script
exec 9< "$STATE_DIR"
More information about the tor-commits
mailing list