summaryrefslogtreecommitdiff
path: root/other/tor/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'other/tor/Makefile')
-rw-r--r--other/tor/Makefile25
1 files changed, 25 insertions, 0 deletions
diff --git a/other/tor/Makefile b/other/tor/Makefile
new file mode 100644
index 0000000..e08ee8e
--- /dev/null
+++ b/other/tor/Makefile
@@ -0,0 +1,25 @@
+TODAY=`TZ=UTC date +'%Y-%m-%d_%H:%M:%S'`
+WGET=wget --cache=off
+OUTDIR=tor-directory
+#SOURCE=http://moria.mit.edu:9031/
+SOURCE=http://tor.noreply.org:9030/
+TMPFILE=download.tmp
+LAST_NAME=dir.last
+
+all:
+ rm -f $(TMPFILE)
+ $(WGET) -q -O $(TMPFILE) $(SOURCE)
+ NAME=directory-$(TODAY); \
+ if [ -e $(LAST_NAME) ] && diff -q $(TMPFILE) $(OUTDIR)/`cat $(LAST_NAME)` >/dev/null ; then \
+ ln $(OUTDIR)/`cat $(LAST_NAME)` $(OUTDIR)/$$NAME; \
+ else \
+ mv $(TMPFILE) $(OUTDIR)/$$NAME; \
+ echo "$$NAME" > $(LAST_NAME); \
+ fi; \
+ bin/rrd-update $$NAME
+ rm -rf result.new
+ mkdir result.new
+ bin/rrd-graph
+ mv result result.old
+ mv result.new result
+ rm -rf result.old