diff --git a/doorlockd-new/config.cfg b/doorlockd-new/config.cfg index 327d580..cb419fa 100644 --- a/doorlockd-new/config.cfg +++ b/doorlockd-new/config.cfg @@ -1,5 +1,6 @@ DEBUG = True SIMULATE = True +RUN_HOOKS = True SECRET_KEY = 'foobar' BOOTSTRAP_SERVE_LOCAL = True diff --git a/doorlockd-new/doorlockd.py b/doorlockd-new/doorlockd.py index 5f515e4..102c49f 100755 --- a/doorlockd-new/doorlockd.py +++ b/doorlockd-new/doorlockd.py @@ -60,6 +60,7 @@ socketio = SocketIO(webapp, async_mode=None) Bootstrap(webapp) serial_port = webapp.config.get('SERIAL_PORT') simulate = webapp.config.get('SIMULATE') +run_hooks = webapp.config.get('RUN_HOOKS') # copied from sudo eperm_insults = { @@ -89,8 +90,8 @@ def choose_insult(): def start_hook(script): - if simulate: - log.info('Simulation mode: not starting %s' % script) + if not run_hooks: + log.info('Hooks disabled: not starting %s' % script) return log.info('Starting hook %s' % script) Popen(['nohup', script])