From: Peter Palfrader Date: Tue, 28 Jan 2014 08:39:45 +0000 (+0100) Subject: Fix verbosity handling in while loop X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=d008b25c8f99582c1cdfa7dea2713bd0ef1a2a5d;p=mirror%2Fdsa-puppet.git Fix verbosity handling in while loop --- diff --git a/modules/postgres/files/backup_server/postgres-make-base-backups b/modules/postgres/files/backup_server/postgres-make-base-backups index d9352bc78..ee9213fff 100755 --- a/modules/postgres/files/backup_server/postgres-make-base-backups +++ b/modules/postgres/files/backup_server/postgres-make-base-backups @@ -36,6 +36,11 @@ if [ -z "$ROOTDIR" ]; then fi if [ -t 0 ]; then + verbose=1 +else + verbose=0 + +if [ "$verbose" -gt 0 ]; then console="--progress --verbose" else console="" @@ -50,7 +55,7 @@ while read host port username cluster version; do [ "${host#\#}" = "$host" ] || continue label="$date-$host-$cluster-$version-backup" - [ -t 0 ] && echo "Doing $host:$port $version/$cluster: $label" + [ "$verbose" -gt 0 ] && echo "Doing $host:$port $version/$cluster: $label" target="$cluster.BASE.$label.tar.gz" tmp=$(tempfile -d "$ROOTDIR" -p "BASE-$host:$port-" -s ".tar.gz")