summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Pokorný <jpokorny@redhat.com>2013-04-19 17:23:19 +0200
committerJan Pokorný <jpokorny@redhat.com>2013-04-19 17:23:19 +0200
commitd7f115388096714df22052b4917427f7d9200dab (patch)
tree8b5c98550110bdebf23be46a0ae0254ff3e6bcf8
parentefe7535a87aaaa03442f18736d7c786a73d0924d (diff)
downloadwatch-bz-d7f115388096714df22052b4917427f7d9200dab.tar.gz
watch-bz-d7f115388096714df22052b4917427f7d9200dab.tar.xz
watch-bz-d7f115388096714df22052b4917427f7d9200dab.zip
limit password prompt to 1 minute
This also means that python-bugzilla's native prompt should never be used. Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
-rwxr-xr-xwatch-bz5
1 files changed, 4 insertions, 1 deletions
diff --git a/watch-bz b/watch-bz
index ff25ff9..f8cea93 100755
--- a/watch-bz
+++ b/watch-bz
@@ -85,6 +85,9 @@ do_logout () {
do_init () {
# login when available
if [ -n "$BZUSER" ] && [ ! -f "${BUGZILLA_COOKIE}" ]; then
+ [ -n "$BZPASSWORD" ] \
+ || read -s -t 60 -p 'Password (1 min timeout): ' BZPASSWORD \
+ || exit $?
"$BUGZILLA" --cookiefile="${BUGZILLA_COOKIE}" login "$BZUSER" $BZPASSWORD
if [ $? -ne 0 ]; then
echo "Cannot log in"
@@ -99,7 +102,7 @@ do_init () {
# exclusively using globals
do_watch () {
#sh -c \
- ${WATCHCMD} -t --interval $REFRESH_INTERVAL --differences=cumulative \
+ ${WATCHCMD} -t --interval $REFRESH_INTERVAL \
"$BUGZILLA --cookiefile="${BUGZILLA_COOKIE}" query -c $COMPONENT \
-t $STATUS --outputformat $OUTPUT_FMT \
| sed -u \