Skip to content

Instantly share code, notes, and snippets.

Created June 8, 2015 15:09
Show Gist options
  • Save anonymous/a22e009e7c1019ba1394 to your computer and use it in GitHub Desktop.
Save anonymous/a22e009e7c1019ba1394 to your computer and use it in GitHub Desktop.
class Shell
OPS = ["gr33n7007h", "al2o3-cr"]
include Cinch::Plugin
match /sh (.+)/
def sh(command)
out = IO.popen("#{command} 2>&1")
end
def execute(m, command)
#if OPS.include?(m.user.nick) && m.user.host == "unaffiliated/gr33n7007h"
m.user.refresh
if OPS.include?(m.user.authname)
sh(command).each do |line|
m.reply(line)
end
else
m.reply("#{m.user.nick} is not authorized to perform this action")
end
end
private :sh
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment