From f2c35e9d135c5b6ecfac5aaed72ff5238ca4e4b6 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Wed, 1 Jun 2016 14:05:53 +0200 Subject: [PATCH] show usage if run outside of extfs context --- tools/encfs_aes_getpass.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/encfs_aes_getpass.py b/tools/encfs_aes_getpass.py index dc9ea34..16cdfd4 100755 --- a/tools/encfs_aes_getpass.py +++ b/tools/encfs_aes_getpass.py @@ -4,7 +4,7 @@ from __future__ import print_function ''' Use TREZOR as a hardware key for opening EncFS filesystem! -Demo usage: +Usage: encfs --standard --extpass=./encfs_aes_getpass.py ~/.crypt ~/crypt ''' @@ -72,6 +72,12 @@ def choose_device(devices): raise Exception("Invalid choice, exiting...") def main(): + + if not 'encfs_root' in os.environ: + sys.stderr.write('\nThis is not a standalone script and is not meant to be run independently.\n') + sys.stderr.write('\nUsage: encfs --standard --extpass=./encfs_aes_getpass.py ~/.crypt ~/crypt\n') + sys.exit(1) + devices = wait_for_devices() transport = choose_device(devices) client = TrezorClient(transport)