From 0d715cdc29abec6031d3e69968247fb9f973c66d Mon Sep 17 00:00:00 2001 From: Diego 'Flameeyes' Pettenò Date: Mon, 30 Jun 2008 11:39:36 +0200 Subject: Add a host.path setting to set the path to the host command. --- data/rbot/plugins/host.rb | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'data/rbot') 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 => query nameserver about domain names and zones for " 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 -- cgit v1.2.3