summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriwakeh <iwakeh@torproject.org>2017-01-16 20:26:07 +0100
committeriwakeh <iwakeh@torproject.org>2017-01-16 20:37:05 +0100
commit5bc248e0e546d7c23f150b18d4c4283a4e8ecc58 (patch)
treee8f6c93f311908a632e112428e8c3836613ce536
parent7752b6d73538140cd34daf2267cc470dcc30b155 (diff)
Added shell-script for correcting exit-list annotations.task-21195
-rwxr-xr-xsrc/main/resources/fix-exitlists-annotation.sh44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/main/resources/fix-exitlists-annotation.sh b/src/main/resources/fix-exitlists-annotation.sh
new file mode 100755
index 0000000..d87830c
--- /dev/null
+++ b/src/main/resources/fix-exitlists-annotation.sh
@@ -0,0 +1,44 @@
+#!/bin/bash
+#
+# Only for upgrading from 1.1.0 or 1.1.1!!!
+#
+# Script for correcting ext-list annotations.
+# See task-21195 for details.
+# Replaces 'torperf' with 'tordnsel' in files
+# and archives.
+#
+#####
+#
+# Please enter absolute paths below.
+#
+# As in collector.properties
+RECENT=
+OUT=
+ARCHIVE=
+#
+# temporary path to use
+TEMP=
+
+function fix() {
+ echo "----> Operating on $1 ..."
+ find $1/$2/ -type f -exec sed -i s/torperf/tordnsel/ {} \;
+ echo "----> $1 done."
+}
+
+echo "-> Starting to fix exit-lists ..."
+fix $OUT "exit-lists"
+fix $RECENT "exit-lists"
+
+for ym in 2016-10 2016-11 2016-12 2017-01 ; do
+ cd $TEMP;
+ ARC="$ARCHIVE/exit-lists/exit-list-$ym.tar.xz"
+ echo "--> Operating on $ARC ..."
+ tar xf $ARC;
+ fix $TEMP exit-list-$ym
+ mv $ARC $ARC-old;
+ tar --remove-files -cJf exit-list-$ym.tar.xz exit-list-$ym
+ mv $TEMP/exit-list-$ym.tar.xz $ARC
+ echo "--> $ARC is done."
+done;
+echo "-> Done. Please verify the results and remove $ARCHIVE/*.tar.xz-old files."
+exit 0;