cinchize

An early version of program which purpose is to daemonize Cinch ircbots from “simple” json config-files.

Installation

gem install cinchize

Usage

Basic

cinchize --start network

The config file can either be in the current working directory or in /etc, should be called cinchize.json, i.e. /etc/cinchize.json, use -s to look for the file in /etc

cinchize -s --start network

To daemonzize, use -d

cinchize -d --start network

Network is the name you call the a server config in the servers part of the config file, i.e. “freenode”, “my_cute_bot”, “quakenet” or similar.

–start, –restart, –stop and –status assumes that the config file is located in the current working directory unless -s is used.

Config-file

All config options can be skipped and the bot will use the defaults, but it could always be nice to connect to a server that isn’t localhost, right? Plugins can be skipped too, but then the bot wouldn’t do anything other then just idle.

{
  "options" : {
    "dir" : "/path/to/pid/dir",
    "dir_mode" : "normal",
    "log_output" : true
  },
  "servers" : {
    "freenode" : {
      "server" : "irc.freenode.net",
      "port" : 6667,
      "nick" : "Cinchbot",
      "channels" : ["#cinchbots"],
      "plugins" : [
        {
          "module" : "plugin-module",
          "class" : "Cinch::Plugins::User::SomePlugin",
          "options" : { 
              "foo" : "bar"
          }
        }
      ]
    }
  }
}

Options explained

dir: the save path, absolute or relative to either /var/run or to the current working directory

dir_mode: “system” to work from /var/run and “normal”, to work from current working directory or from an absolute path

log_output: writes STDERR and STDOUT to a logfile in the same dir as the pid-file

Copyright © 2010 Victor Bergöö. See LICENSE for details.