+
+ begin
+ leftover_accounts = plugin.get_leftover_accounts(db_accounts)
+ rescue StandardError => e
+ puts "There was an error retrieving accounts from the filesystem: #{e.to_s}"
+ Kernel.exit(ExitCodes::FILESYSTEM_ERROR)
+ end
+
+ if leftover_domains.size > 0 or leftover_accounts.size > 0
+ # The header that we output before the list of domains/accounts.
+ # Just the path of this script, the current time, and the plugin name.
+ header = "#{$0}, "
+
+ current_time = Time.now()
+ if current_time.respond_to?(:iso8601)
+ # Somehow this method is missing on some machines.
+ header += current_time.iso8601.to_s
+ else
+ # Fall back to whatever this looks like.
+ header += current_time.to_s + "\n"
+ end
+
+ header += 'Plugin: ' + plugin_name + "\n"
+ puts header
+ puts '-' * header.size # Underline the header.
+
+ leftover_domains.each do |domain|
+ puts "Found: #{domain} (#{plugin.describe_domain(domain)})"
+ end
+
+ leftover_accounts.each do |account|
+ puts "Found: #{account} (#{plugin.describe_account(account)})"
+ end
+
+ if Configuration::I_MEAN_BUSINESS
+ leftover_domains.each do |domain|
+ plugin.delete_domain(domain)
+ puts "Removed: #{domain} (#{plugin.describe_domain(domain)})"
+ end
+
+ leftover_accounts.each do |account|
+ plugin.delete_account(account)
+ puts "Removed: #{account} (#{plugin.describe_account(account)})"
+ end
+ end
+
+ puts ""
+ end
+