lib/cogbot.rb in cogbot-0.1.4 vs lib/cogbot.rb in cogbot-0.1.5
- old
+ new
@@ -33,11 +33,11 @@
Daemons.daemonize(
:app_name => 'cogbot',
:dir_mode => :normal,
:log_dir => LOG_DIR,
:log_output => true,
- :dir => File.join('/', 'tmp')
+ :dir => CONFIG_DIR
)
# checkout plugins
plugins = []
config['main']['plugins'].each do |p|
@@ -57,10 +57,12 @@
c.ssl.use = ( config['main']['ssl'] == 'true' )
c.nick = config['main']['nick']
c.user = config['main']['nick']
c.realname = config['main']['nick']
c.channels = config['main']['channels']
+ c.sasl.username = config['main']['sasl_user']
+ c.sasl.password = config['main']['sasl_pass']
c.options = { 'cogconf' => config }
c.plugins.prefix = config['main']['prefix']
c.plugins.plugins = plugins
end
on :message, "hi" do |m|
@@ -89,10 +91,10 @@
end
desc "stop", "stop cogbot"
# manages the stop cli command
def stop
- pid_file = File.join('/', 'tmp', 'cogbot.pid')
+ pid_file = File.join(CONFIG_DIR, 'cogbot.pid')
pid = File.read(pid_file).to_i if File.exist?(pid_file)
Process.kill('TERM', pid)
end
desc "restart", "restart cogbot"