mirror of
https://github.com/binary-kitchen/doorlockd
synced 2024-12-22 18:34:25 +01:00
doorlockd.py: Add config parameter for hooks
Signed-off-by: Ralf Ramsauer <ralf@binary-kitchen.de>
This commit is contained in:
parent
6e2655e6e5
commit
4d1682d1bd
@ -1,5 +1,6 @@
|
|||||||
DEBUG = True
|
DEBUG = True
|
||||||
SIMULATE = True
|
SIMULATE = True
|
||||||
|
RUN_HOOKS = True
|
||||||
SECRET_KEY = 'foobar'
|
SECRET_KEY = 'foobar'
|
||||||
|
|
||||||
BOOTSTRAP_SERVE_LOCAL = True
|
BOOTSTRAP_SERVE_LOCAL = True
|
||||||
|
@ -60,6 +60,7 @@ socketio = SocketIO(webapp, async_mode=None)
|
|||||||
Bootstrap(webapp)
|
Bootstrap(webapp)
|
||||||
serial_port = webapp.config.get('SERIAL_PORT')
|
serial_port = webapp.config.get('SERIAL_PORT')
|
||||||
simulate = webapp.config.get('SIMULATE')
|
simulate = webapp.config.get('SIMULATE')
|
||||||
|
run_hooks = webapp.config.get('RUN_HOOKS')
|
||||||
|
|
||||||
# copied from sudo
|
# copied from sudo
|
||||||
eperm_insults = {
|
eperm_insults = {
|
||||||
@ -89,8 +90,8 @@ def choose_insult():
|
|||||||
|
|
||||||
|
|
||||||
def start_hook(script):
|
def start_hook(script):
|
||||||
if simulate:
|
if not run_hooks:
|
||||||
log.info('Simulation mode: not starting %s' % script)
|
log.info('Hooks disabled: not starting %s' % script)
|
||||||
return
|
return
|
||||||
log.info('Starting hook %s' % script)
|
log.info('Starting hook %s' % script)
|
||||||
Popen(['nohup', script])
|
Popen(['nohup', script])
|
||||||
|
Loading…
Reference in New Issue
Block a user