[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [collector/master] Added shell-script for correcting exit-list annotations.
commit feff68f76790f06d146257f490f5235f7bbd97d9
Author: iwakeh <iwakeh@xxxxxxxxxxxxxx>
Date: Mon Jan 16 20:26:07 2017 +0100
Added shell-script for correcting exit-list annotations.
---
src/main/resources/fix-exitlists-annotation.sh | 45 ++++++++++++++++++++++++++
1 file changed, 45 insertions(+)
diff --git a/src/main/resources/fix-exitlists-annotation.sh b/src/main/resources/fix-exitlists-annotation.sh
new file mode 100755
index 0000000..e77d806
--- /dev/null
+++ b/src/main/resources/fix-exitlists-annotation.sh
@@ -0,0 +1,45 @@
+#!/bin/bash
+#
+# Only for upgrading from 1.1.0 or 1.1.1!!!
+#
+# Script for correcting exit-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 -cf exit-list-$ym.tar exit-list-$ym
+ xz -9e exit-list-$ym.tar
+ 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;
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits