summaryrefslogtreecommitdiff
path: root/destroy-all-user-dbs
blob: 0985dc613a36415d4d69fa141badb3b202b74974 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/ruby

unless ARGV.grep('--force').any?
  puts
  puts "DANGER!"
  puts
  puts "Are you sure you want to entirely delete all per-user storage dbs?"
  puts "Run with --force if you really want to do this."
  puts "Note: this script will not clean up the `users` db or the `identities` db."
  puts
end

require_relative "lib/leap"

server   = LEAP::Server.new
server.databases.each do |db_name|
  if db_name =~ /^user-[a-f0-9]{32}$/
    puts 'destroying %s' % db_name
    server.database(db_name).delete!
  end
end