diff options
author | Dieter Plaetinck <dieter@plaetinck.be> | 2009-03-12 21:33:36 +0100 |
---|---|---|
committer | Dieter Plaetinck <dieter@plaetinck.be> | 2009-03-12 21:33:36 +0100 |
commit | a97a7ec396b082f8315a46bf57875c4088a9bbc8 (patch) | |
tree | 1004893ab97b3932708701aac2e5a8386e674887 /src/core/libs/lib-ui.sh | |
parent | a6cc5cce7cf5d8a18f605c2764f57b512b5c8683 (diff) |
support for storing the pid of background wrapper processes + support for non-blocking following of text files (eg tail --pid)
Diffstat (limited to 'src/core/libs/lib-ui.sh')
-rw-r--r-- | src/core/libs/lib-ui.sh | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/core/libs/lib-ui.sh b/src/core/libs/lib-ui.sh index 9719cbf..c438dc2 100644 --- a/src/core/libs/lib-ui.sh +++ b/src/core/libs/lib-ui.sh @@ -262,6 +262,7 @@ ask_yesno () # follow the progress of something by showing it's log, updating real-time # $1 title # $2 logfile +# $3 pid to monitor. if process stopped, stop following (only used in cli mode) follow_progress () { [ -z "$1" ] && die_error "follow_progress needs a title!" @@ -639,8 +640,8 @@ _cli_follow_progress () title=$1 logfile=$2 echo "Title: $1" - tail -f $2 - #TODO: don't block anymore when it's done + [ -n "$3" ] && tail -f $2 --pid=$3 + [ -z "$3" ] && tail -f $2 } set_keymap () |