diff options
author | makefu <github@syntax-fehler.de> | 2011-09-06 21:22:54 +0200 |
---|---|---|
committer | makefu <github@syntax-fehler.de> | 2011-09-06 21:22:54 +0200 |
commit | 93fc9d2eb6bd59858453f20ad23bd241b4ebab29 (patch) | |
tree | 34a33e7d00f289d7bed0a518cf4215601f46e8bf /cholerab/IRC-RPC | |
parent | c5b5d61f276a5ac4d2243db48e7e8afc5323679d (diff) | |
parent | 229b805732cc34c30bb287aa750fbd14df94cc81 (diff) |
Merge branch 'master' of github.com:krebscode/painload
Diffstat (limited to 'cholerab/IRC-RPC')
-rw-r--r-- | cholerab/IRC-RPC | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/cholerab/IRC-RPC b/cholerab/IRC-RPC new file mode 100644 index 00000000..a5350534 --- /dev/null +++ b/cholerab/IRC-RPC @@ -0,0 +1,32 @@ +# Krebs IRC RPC + + on :<from> PRIVMSG <target> :<handle>: <command> <argument> + + if <handle> ∈ { nickname, "ALL" } + if <command> is a public command + + path = $__public_command_directory/<command> + argv = [] + envp = { from: <from>, argument: <argument> } + + <code> = execve(path, argv, envp) → <stdout>, <stderr> + + if <code> = 0 + if <target> is channel + PRIVMSG <target> :<from>: <stdout> + PRIVMSG <from> :<stderr> + else + ; TODO assert <target> = <from> + PRIVMSG <from> :<stdout> + PRIVMSG <from> :Error: <stderr> + else + + send all <.*> to the Ministerium + + if <target> is channel + PRIVMSG <target> :<from>: <command> is broken ATM + else + PRIVMSG <target> :Error: <command> is broken ATM + + else + PRIVMSG <target> :<from>: you are made of stupid |