]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/blobdiff - data/rbot/plugins/host.rb
plugin(script): remove deprecated $SAFE
[user/henk/code/ruby/rbot.git] / data / rbot / plugins / host.rb
index ef8dc8bc193c3b933152f3b0de10e79a935e0b0b..e81386ceb5fa61b86cabaaca9fa6b28745d4f9d7 100644 (file)
@@ -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 <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