summaryrefslogtreecommitdiffstats
path: root/cholerab/IRC-RPC
diff options
context:
space:
mode:
authorChinaman <root@chinaman>2011-09-06 19:47:58 +0200
committerChinaman <root@chinaman>2011-09-06 19:47:58 +0200
commit108f3616e3f4958752d881192ef29e5fc4c2b045 (patch)
tree3c67478c852265219b72e6e1b05467d7065b7ba8 /cholerab/IRC-RPC
parentb2d65500160bcdf7abb2bf985f7da582b810e25c (diff)
parentc3bc5a6d16868c121aca780f3109155797b51d76 (diff)
Merge branch 'master' of github.com:krebscode/painload
Diffstat (limited to 'cholerab/IRC-RPC')
-rw-r--r--cholerab/IRC-RPC32
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