diff options
author | An-Cheng Huang <ancheng@vyatta.com> | 2009-11-02 15:46:37 -0800 |
---|---|---|
committer | An-Cheng Huang <ancheng@vyatta.com> | 2009-11-02 15:46:37 -0800 |
commit | d07ddbc5b98f739bebc8fd7ecdf2a6a6fe5d8375 (patch) | |
tree | e0e346dfe0d50e4214cf5bbd51a85bdb7cd8b085 /scripts/install/install-functions | |
parent | 56339a193bb7e94667e12e97f98937e4544e4158 (diff) | |
download | vyatta-cfg-quagga-d07ddbc5b98f739bebc8fd7ecdf2a6a6fe5d8375.tar.gz vyatta-cfg-quagga-d07ddbc5b98f739bebc8fd7ecdf2a6a6fe5d8375.zip |
use top-level pid for progress indicator
Diffstat (limited to 'scripts/install/install-functions')
-rwxr-xr-x | scripts/install/install-functions | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/scripts/install/install-functions b/scripts/install/install-functions index 3bdc1fde..29707dff 100755 --- a/scripts/install/install-functions +++ b/scripts/install/install-functions @@ -43,18 +43,20 @@ VYATTA_CFG_DIR=${vyatta_sysconfdir}/config # the floppy config dir FD_CFG_DIR=/media/floppy/config -# Process ID for progress_indicator -SPID=$$ - +# PROGRESS_PID can be exported by top-level script progress_indicator () { + local spid=$PROGRESS_PID + if [ -z "$spid" ]; then + spid=$$ + fi case "$1" in start) - $vyatta_bindir/progress-indicator $SPID & + $vyatta_bindir/progress-indicator $spid & ;; *) - if ! rm /tmp/pi.$SPID 2>/dev/null; then + if ! rm /tmp/pi.$spid 2>/dev/null; then sleep 1 - rm /tmp/pi.$SPID 2>/dev/null + rm /tmp/pi.$spid 2>/dev/null fi sleep 1 echo -n -e "\b" |