diff options
author | EUcancER <root@euer.krebsco.de> | 2011-09-01 11:02:40 +0200 |
---|---|---|
committer | EUcancER <root@euer.krebsco.de> | 2011-09-01 11:02:40 +0200 |
commit | 37491fdc8cdb5349ab0377d3e528231d0cffe07a (patch) | |
tree | 68d08e8151905d42fe273fa6991f086059f0ebe5 /god/Reaktor/index | |
parent | 9a7a3afcb949ebe807965d154c00836c462177ff (diff) | |
parent | 9198f99c6640ffc2a8de752b456a9c91f03edbcd (diff) |
Merge branch 'master' of github.com:krebscode/painload
Diffstat (limited to 'god/Reaktor/index')
-rwxr-xr-x | god/Reaktor/index | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/god/Reaktor/index b/god/Reaktor/index new file mode 100755 index 00000000..a2e6fe61 --- /dev/null +++ b/god/Reaktor/index @@ -0,0 +1,37 @@ +#! /bin/sh +# +# //god/Reaktor - listen to UDP events and forward them to IRC +# +# export host passwd printto to configure jsb-udp +# +set -euf +cd $(readlink -f $(dirname $0)) + +listener=$(readlink -f lib/listener.py) + +jsb_version=0.7.1.2 +distdir=jsb-$jsb_version.tar.gz + +host=${host-91.206.142.247} +passwd=${passwd-h4x0r} +printto=${printto-#shackspace} + +if ! test -x tmp/jsb-$jsb_version; then + mkdir -p tmp + cd tmp + curl -f http://jsonbot.googlecode.com/files/jsb-$jsb_version.tar.gz | tar zx + cd jsb-$jsb_version + bin/jsb-udp -s </dev/null + cd ../.. +fi +cd tmp/jsb-$jsb_version + +# TODO only if it is not already configured properly +sed -i ' + s/^host *=.*/host="'$host'"/ + s/^passwd *=.*/passwd="'$passwd'"/ + s/^printto *=.*/printto="'$printto'"/ +' config/udp-send + +# TODO output modules: stderr, jsb-udp, remount-ro, ... +PYTHONUNBUFFERED=y $listener | tee /dev/stderr | bin/jsb-udp |