summaryrefslogtreecommitdiffstats
path: root/Reaktor/reaktor
diff options
context:
space:
mode:
Diffstat (limited to 'Reaktor/reaktor')
-rwxr-xr-xReaktor/reaktor/commands/tell-on_join3
-rw-r--r--Reaktor/reaktor/config.py13
2 files changed, 12 insertions, 4 deletions
diff --git a/Reaktor/reaktor/commands/tell-on_join b/Reaktor/reaktor/commands/tell-on_join
index 2dbff41a..bb4982cc 100755
--- a/Reaktor/reaktor/commands/tell-on_join
+++ b/Reaktor/reaktor/commands/tell-on_join
@@ -1,13 +1,14 @@
#! /bin/sh
set -euf
-# require flock from util-linux
+# require flock from util-linux (pkgs.utillinux)
if test "${FLOCK-}" != "$state_file"; then
exec env FLOCK="$state_file" flock "$state_file" "$0" "$@"
fi
to="$_from"
+test -e "$state_file" || touch "$state_file"
# print messages
sed -n '/^'"$to"' /{
s/^\([^ ]\+\) \([^ ]\+\) <\([^>]\+\)> \(.*\)/\1: \4 2-- \2, \3/p
diff --git a/Reaktor/reaktor/config.py b/Reaktor/reaktor/config.py
index 73daa81f..85824321 100644
--- a/Reaktor/reaktor/config.py
+++ b/Reaktor/reaktor/config.py
@@ -10,8 +10,15 @@ debug = True
name = os.environ.get('IRC_NICKNAME','crabmanner')
-#workdir = expanduser('~') + '/state'
-workdir = './state'
+#workdir = './state'
+workdir = expanduser('~') + '/state'
+
+# TODO: YAY more functionality in config.py ..
+# if this fails the bot will fail (which is ok)
+if not os.path.isdir(workdir): os.makedirs(workdir)
+
+
+
irc_alarm_timeout = 300
irc_hammer_interval = 10
@@ -36,7 +43,7 @@ config_filename = abspath(__file__)
mod_dir=dirname(abspath(reaktor.__file__))
# the commands dirname (
-dist_dir = abspath(join(mod_dir,".."))
+dist_dir = abspath(join(mod_dir))
# me is used, so name cannot kill our patterns below