/*
goircd -- minimalistic simple Internet Relay Chat (IRC) server
-Copyright (C) 2014 Sergey Matveev <stargrave@stargrave.org>
+Copyright (C) 2014-2015 Sergey Matveev <stargrave@stargrave.org>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+
package main
import (
"io/ioutil"
"log"
"net"
- "os"
- "os/signal"
"path"
"path/filepath"
"strings"
- "syscall"
)
var (
log.Println("Error during accepting connection", err)
continue
}
- client := NewClient(*hostname, conn)
+ client := NewClient(hostname, conn)
go client.Processor(events)
}
}
} else {
if !path.IsAbs(*logdir) {
log.Fatalln("Need absolute path for logdir")
- return
}
go Logger(*logdir, logSink)
log.Println(*logdir, "logger initialized")
}
stateSink := make(chan StateEvent)
- daemon := NewDaemon(version, *hostname, *motd, logSink, stateSink)
+ daemon := NewDaemon(version, hostname, motd, passwords, logSink, stateSink)
daemon.Verbose = *verbose
- log.Println("goircd "+daemon.version+" is starting")
+ log.Println("goircd " + daemon.version + " is starting")
if *statedir == "" {
// Dummy statekeeper
go func() {
log.Println(*statedir, "statekeeper initialized")
}
- if *passwords != "" {
- daemon.PasswordsRefresh()
- hups := make(chan os.Signal)
- signal.Notify(hups, syscall.SIGHUP)
- go func() {
- for {
- <-hups
- daemon.PasswordsRefresh()
- }
- }()
- }
-
-
if *bind != "" {
listener, err := net.Listen("tcp", *bind)
if err != nil {