summaryrefslogtreecommitdiff
path: root/bin/nickserver
blob: de7e33435feeda7337902eddc689ffc017e3324f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/ruby

#
# Nickserver key discovery daemon
#

#
# bootstrap nickserver library
#
begin                      # try without rubygems (might be already loaded or not present)
  require 'nickserver'
rescue LoadError
  begin                    # try with rubygems
    require 'rubygems'
    require 'nickserver'
  rescue LoadError         # try manually
    BASE_DIR = File.expand_path('../..', File.symlink?(__FILE__) ? File.readlink(__FILE__) : __FILE__)
    $LOAD_PATH << "#{BASE_DIR}/lib"
    require "nickserver"
  end
end

Nickserver::Daemon.run('nickserver') do
  EventMachine.run do
    Nickserver::Server.start
  end
end