diff --git a/telegram-notify.py b/telegram-notify.py index 89200e1..862d669 100644 --- a/telegram-notify.py +++ b/telegram-notify.py @@ -162,7 +162,13 @@ configParser = ConfigParser.RawConfigParser() configParser.read('telegram-notify.conf') spool_dir = configParser.get('general', 'spool_dir') -# TODO: check if spool_dir exists and is a dir +if not os.path.isdir(spool_dir): + print "spool directory (%s) doesn't exists or is not a directory!" % spool_dir + sys.exit(1) + +if not os.access(spool_dir, os.W_OK): + print "spool directory (%s) is not writable!" % spool_dir + sys.exit(1) chat_ids=[] print "Allowed users: "