2015-10-15 19:04:24 +00:00
|
|
|
package main
|
2015-10-15 14:50:32 +00:00
|
|
|
|
|
|
|
import (
|
2015-10-19 23:54:07 +00:00
|
|
|
"fmt"
|
|
|
|
"log"
|
|
|
|
"math/rand"
|
|
|
|
"os"
|
|
|
|
"time"
|
2015-10-15 14:50:32 +00:00
|
|
|
|
2015-10-19 23:54:07 +00:00
|
|
|
"github.com/arachnist/gorepost/config"
|
2015-10-19 23:56:34 +00:00
|
|
|
"github.com/arachnist/gorepost/irc"
|
2015-10-15 14:50:32 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2015-10-19 23:54:07 +00:00
|
|
|
config, err := config.ReadConfig(os.Args[1])
|
|
|
|
if err != nil {
|
|
|
|
fmt.Println("Error reading configuration from", os.Args[1], "error:", err.Error())
|
|
|
|
os.Exit(1)
|
|
|
|
}
|
2015-10-15 19:04:24 +00:00
|
|
|
|
2015-10-19 23:54:07 +00:00
|
|
|
logfile, err := os.OpenFile(config.Logpath, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666)
|
|
|
|
if err != nil {
|
|
|
|
fmt.Println("Error opening", config.Logpath, "for writing, error:", err.Error())
|
|
|
|
os.Exit(1)
|
|
|
|
}
|
|
|
|
log.SetOutput(logfile)
|
2015-10-19 08:37:08 +00:00
|
|
|
|
2015-10-15 14:50:32 +00:00
|
|
|
}
|