X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=rbot%2Fplugins%2Ffortune.rb;h=6d077c85322cd9ce5d27ed56c61af03329b0e25a;hb=b936c58c119eeea7b5ab1fc31d25724bd949ea9d;hp=fd90f69bfb5e0f054d0d5d50eaee0b86d6aebc19;hpb=b59c4293feddf796d2306dd4b69cb92faff8a802;p=user%2Fhenk%2Fcode%2Fruby%2Frbot.git diff --git a/rbot/plugins/fortune.rb b/rbot/plugins/fortune.rb index fd90f69b..6d077c85 100644 --- a/rbot/plugins/fortune.rb +++ b/rbot/plugins/fortune.rb @@ -17,7 +17,10 @@ class FortunePlugin < Plugin end fortune = nil ["/usr/games/fortune", "/usr/bin/fortune", "/usr/local/bin/fortune"].each {|f| - fortune = f if FileTest.executable? f + if FileTest.executable? f + fortune = f + break + end } m.reply "fortune not found" unless fortune ret = Utils.safe_exec(fortune, "-n", "255", "-s", db)