aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormakefu <root@pigstarter.de>2014-04-25 15:22:51 +0200
committermakefu <root@pigstarter.de>2014-04-25 15:22:51 +0200
commitaafb675679b0db733e391bb64f5f3ce0aef4a741 (patch)
tree2692209407ac39561dcc3b3d16a966814e33afcd
parenta23f8d14ebf1cd5cbf5900d02978ac6f78bbee67 (diff)
add fallback for non existing directory
-rwxr-xr-xIRC/reaktor.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/IRC/reaktor.py b/IRC/reaktor.py
index bfd08d9..ec306e7 100755
--- a/IRC/reaktor.py
+++ b/IRC/reaktor.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
import os
from ircasy import asybot
from asyncore import loop
@@ -69,6 +69,9 @@ class Reaktor(asybot):
log.info("cannot parse args!")
cwd = getconf('workdir')
+ if not os.access(cwd,os.W_OK):
+ log.error("Workdir '%s' is not Writable! Falling back to root dir"%cwd)
+ cwd = "/"
env = command.get('env', {})
env['_prefix'] = prefix