summaryrefslogtreecommitdiff
path: root/data/rbot/plugins
diff options
context:
space:
mode:
authorDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2008-06-30 11:39:36 +0200
committerDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2008-06-30 12:00:39 +0200
commit0d715cdc29abec6031d3e69968247fb9f973c66d (patch)
treeaaf6ee1312e32ef7d396eed6f23736fb5d04fa37 /data/rbot/plugins
parent8dd10a34da81fd11c562dd4db6a23a6f4abc533c (diff)
Add a host.path setting to set the path to the host command.
Diffstat (limited to 'data/rbot/plugins')
-rw-r--r--data/rbot/plugins/host.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/data/rbot/plugins/host.rb b/data/rbot/plugins/host.rb
index ef8dc8bc..c5fbcdaa 100644
--- a/data/rbot/plugins/host.rb
+++ b/data/rbot/plugins/host.rb
@@ -1,13 +1,22 @@
class HostPlugin < Plugin
+ Config.register Config::StringValue.new('host.path',
+ :default => '/usr/bin/host',
+ :desc => _('Path to the host program'))
+
def help(plugin, topic="")
"host <domain> => query nameserver about domain names and zones for <domain>"
end
+
+ def host_path
+ @bot.config["host.path"]
+ end
+
def privmsg(m)
unless(m.params =~ /^(\w|-|\.)+$/)
m.reply "incorrect usage: " + help(m.plugin)
return
end
- m.reply Utils.safe_exec("host", m.params)
+ m.reply Utils.safe_exec(host_path, m.params)
end
end
plugin = HostPlugin.new