summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Pokorný <jpokorny@redhat.com>2013-05-17 17:18:16 +0200
committerJan Pokorný <jpokorny@redhat.com>2013-05-17 17:18:16 +0200
commite012de78d5934e5797197f01ef267426e008a53b (patch)
treea9b680449f9a6882774ac9fe06e144d774989a3a
parent30b2b1d44f8f4c961f9d45cef92304a308d91bc1 (diff)
downloadwatch-bz-e012de78d5934e5797197f01ef267426e008a53b.tar.gz
watch-bz-e012de78d5934e5797197f01ef267426e008a53b.tar.xz
watch-bz-e012de78d5934e5797197f01ef267426e008a53b.zip
Handle interrupt when waiting for password input gracefully
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
-rwxr-xr-xwatch-bz2
1 files changed, 2 insertions, 0 deletions
diff --git a/watch-bz b/watch-bz
index d8d7aab..5370b17 100755
--- a/watch-bz
+++ b/watch-bz
@@ -89,6 +89,7 @@ do_logout () {
do_init_login () {
if [ -z "$BZPASSWORD" ]; then
+ trap 'stty echo; exit' INT
trap return USR1
{
timeout 60 /bin/sh -c \
@@ -100,6 +101,7 @@ do_init_login () {
} & read -s -p 'Password (1 min timeout): ' BZPASSWORD \
|| return $?
trap '' USR1
+ trap '' INT
fi
rm -f -- ${BUGZILLA_COOKIE}.init