From 95c35e7c06bf4ce1b5083dc7f9460e1173f26a62 Mon Sep 17 00:00:00 2001 From: Ralf Ramsauer Date: Wed, 5 Sep 2018 21:47:42 +0000 Subject: [PATCH] Let scriptdir depend on PREFIX Signed-off-by: Ralf Ramsauer --- doorlockd | 7 ++++--- {scripts => share/doorlockd/scripts}/post_lock | 0 {scripts => share/doorlockd/scripts}/post_unlock | 0 3 files changed, 4 insertions(+), 3 deletions(-) rename {scripts => share/doorlockd/scripts}/post_lock (100%) rename {scripts => share/doorlockd/scripts}/post_unlock (100%) diff --git a/doorlockd b/doorlockd index 4e0d210..95b5663 100755 --- a/doorlockd +++ b/doorlockd @@ -43,6 +43,7 @@ root_prefix = join(PREFIX, 'share', 'doorlockd') sounds_prefix = join(root_prefix, 'sounds') static_folder = join(root_prefix, 'static') template_folder = join(root_prefix, 'templates') +scripts_prefix = join(root_prefix, 'scripts') flask_config = join(SYSCONFDIR, 'doorlockd.cfg') @@ -136,15 +137,15 @@ def start_hook(script): log.info('Hooks disabled: not starting %s' % script) return log.info('Starting hook %s' % script) - Popen(['nohup', script]) + Popen(['nohup', join(scripts_prefix, script)]) def run_lock(): - start_hook('./scripts/post_lock') + start_hook('post_lock') def run_unlock(): - start_hook('./scripts/post_unlock') + start_hook('post_unlock') class AuthMethod(Enum): diff --git a/scripts/post_lock b/share/doorlockd/scripts/post_lock similarity index 100% rename from scripts/post_lock rename to share/doorlockd/scripts/post_lock diff --git a/scripts/post_unlock b/share/doorlockd/scripts/post_unlock similarity index 100% rename from scripts/post_unlock rename to share/doorlockd/scripts/post_unlock