changeset 1661:1cfebde69814

Don't break terminal on Ctrl-c when reading password PR2268 Reviewed-by: jerboaa Review-thread: http://icedtea.classpath.org/pipermail/thermostat/2015-March/013058.html
author Omair Majid <omajid@redhat.com>
date Tue, 10 Mar 2015 11:39:31 -0400
parents c6ae78b6f3ac
children 3a710779b87f
files distribution/scripts/thermostat-setup
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/distribution/scripts/thermostat-setup	Wed Mar 11 15:07:27 2015 +0100
+++ b/distribution/scripts/thermostat-setup	Tue Mar 10 11:39:31 2015 -0400
@@ -56,6 +56,8 @@
 # For debugging
 #set -xv
 
+tty_flags="$(stty -g)"
+
 # Interruptions are failures
 trap exitFail SIGINT
 
@@ -122,6 +124,7 @@
   removeTempStampFile
   cleanupSedFiles
   echo 'Thermostat setup failed!' 1>&2
+  stty "$tty_flags"
   exit 1
 }