From 00d6b23ceccf80dcffa2302e575e0ca45c770d10 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Wed, 24 Jul 2019 16:16:41 +0200 Subject: [PATCH] Only run tset if running in a interractive tty --- zmldapsync/zmldapsync.pl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/zmldapsync/zmldapsync.pl b/zmldapsync/zmldapsync.pl index fc2707a..5314683 100644 --- a/zmldapsync/zmldapsync.pl +++ b/zmldapsync/zmldapsync.pl @@ -666,9 +666,11 @@ DOMAIN: foreach my $domain ( keys $conf->{domains} ) { } } -# zmprov breaks terminal (no echo to your input after execution) -# fix it with a tset -system('tset'); +if ( -t STDIN and -t STDOUT ) { + # zmprov breaks terminal (no echo to your input after execution) + # fix it with a tset + system('tset'); +} # Exit with the global exit code (if at least one domain had an error, it'll be != 0) exit $exit;