From 6219119476d35b24be5a83dd8956947db2463c3a Mon Sep 17 00:00:00 2001 From: jnphilipp Date: Sat, 17 Feb 2018 09:48:39 +0100 Subject: [PATCH] Update output. --- misc/userscripts/tor_identity | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/misc/userscripts/tor_identity b/misc/userscripts/tor_identity index 7eada7fbf..1b0e317ca 100755 --- a/misc/userscripts/tor_identity +++ b/misc/userscripts/tor_identity @@ -38,5 +38,8 @@ password = sys.argv[1] with Controller.from_port(port=9051) as controller: controller.authenticate(password) controller.signal(Signal.NEWNYM) - with open(os.environ['QUTE_FIFO'], 'w') as f: - f.write('message-info "Tor identity changed."') + if os.getenv('QUTE_FIFO'): + with open(os.environ['QUTE_FIFO'], 'w') as f: + f.write('message-info "Tor identity changed."') + else: + print('Tor identity changed.')