X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;ds=sidebyside;f=data%2Frbot%2Fplugins%2Fhost.rb;h=e81386ceb5fa61b86cabaaca9fa6b28745d4f9d7;hb=d19058b6c071d754a6cc8143acd7e2c50ae12d93;hp=ef8dc8bc193c3b933152f3b0de10e79a935e0b0b;hpb=21949774b91eaec6ecde4eaa8ad121e2c0a36b87;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/data/rbot/plugins/host.rb b/data/rbot/plugins/host.rb index ef8dc8bc..e81386ce 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 => '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