Created
June 8, 2015 15:09
-
-
Save anonymous/a22e009e7c1019ba1394 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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