diff options
author | Peter Palfrader <peter@palfrader.org> | 2007-10-08 23:40:52 +0000 |
---|---|---|
committer | Peter Palfrader <peter@palfrader.org> | 2007-10-08 23:40:52 +0000 |
commit | ff19400cb0d8c558c6e7a8937cd759bc9a76d795 (patch) | |
tree | 09099ba42c4a5d222f629e4065b26734c6acef6e /contrib/auto-naming/build-approved-routers | |
parent | 11a782a6c3ae1d7becbc7895f5e896ed099c1d78 (diff) | |
download | tor-ff19400cb0d8c558c6e7a8937cd759bc9a76d795.tar.gz tor-ff19400cb0d8c558c6e7a8937cd759bc9a76d795.zip |
Commit this stuff somewhere before I delete it accidentally
svn:r11794
Diffstat (limited to 'contrib/auto-naming/build-approved-routers')
-rwxr-xr-x | contrib/auto-naming/build-approved-routers | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/contrib/auto-naming/build-approved-routers b/contrib/auto-naming/build-approved-routers new file mode 100755 index 0000000000..dcc597e6f8 --- /dev/null +++ b/contrib/auto-naming/build-approved-routers @@ -0,0 +1,22 @@ +#!/usr/bin/ruby + +require "yaml" + +require 'db' +require 'db-config' + +verbose = ARGV.first == "-v" + +db = Db.new($CONFIG['database']['dbname'], $CONFIG['database']['user'], $CONFIG['database']['password']) + +db.transaction_begin +named = db.query2(" + SELECT fingerprint, router_id, nickname_id, nick, first_seen, last_seen + FROM router NATURAL JOIN router_claims_nickname NATURAL JOIN nickname + WHERE named") +while (n=named.next) do + puts "# (r##{n['router_id']},n##{n['nickname_id']}); first_seen: #{n['first_seen']}, last_seen: #{n['last_seen']}" + fpr = n['fingerprint'].split(/(....)/).delete_if{|x| x=="" }.join(' ') + puts "#{n['nick']} #{fpr}}" +end +db.transaction_commit |