#!/usr/bin/env ruby # # ildusd - daemon for Dynamic DNS management using a database and the ILDUS protocol # # Copyright (C) 2005 Paul van Tilburg # # Ildus is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free # Software Foundation; either version 2 of the License, or (at your option) # any later version. # # Ildus is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more # details. # # You should have received a copy of the GNU General Public License along # with Ildus; see the file COPYING. If not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, # USA. require 'getoptlong' require 'ildus/server' # Set the program name and version. $0 = $0.split[-1] Program = File.basename $0 Version = '1.1' # Usage and version printing methods. def print_usage puts < Ildus comes with ABSOLUTELY NO WARRANTY; This is free software, and you are welcome to redistribute it under certain conditions; for details see the COPYING file. START ['INT', 'TERM', 'QUIT'].each do |sig| Signal.trap(sig) { server.shutdown } end server.start rescue StandardError => e puts "#{Program}: #{e}" exit 2 end