diff options
author | root <root@krebs> | 2011-09-01 02:18:42 +0200 |
---|---|---|
committer | root <root@krebs> | 2011-09-01 02:18:42 +0200 |
commit | 181ee880f53e1b10fce89e74ba429e23382809c1 (patch) | |
tree | 2f0f392274a6794f7962ec9dbd13e719e48ca5f7 /god/Reaktor/index | |
parent | cdbc8c537320e3e534694311516ac398ea501600 (diff) | |
parent | 5ad8c950f59472d1d0ad21c13320024889fe2e46 (diff) |
Merge branch 'master' of github.com:/krebscode/painload
Conflicts:
.gitmodules
oncology/dpfhack_display
Diffstat (limited to 'god/Reaktor/index')
-rwxr-xr-x | god/Reaktor/index | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/god/Reaktor/index b/god/Reaktor/index new file mode 100755 index 00000000..6470298e --- /dev/null +++ b/god/Reaktor/index @@ -0,0 +1,36 @@ +#! /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 + +PYTHONUNBUFFERED=y $listener | tee /dev/stderr | bin/jsb-udp |