From 63c198ac6adab5417fa61f13de3c25291fee0bf6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Antoine=20Beaupr=C3=A9?= <anarcat@anarcat.ath.cx>
Date: Tue, 21 Oct 2008 23:46:39 +0000
Subject: [PATCH] fix gzip switch

---
 src/sqlbackup.sh | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/sqlbackup.sh b/src/sqlbackup.sh
index 4226f95c..accac8fc 100755
--- a/src/sqlbackup.sh
+++ b/src/sqlbackup.sh
@@ -245,10 +245,12 @@ function dobck() {
        if [ "$DO_BACKUP" == "YES" ]; then
            command="mysqldump --defaults-file=/etc/alternc/my.cnf --add-drop-table --allow-keywords --quote-names --force --quick --add-locks --lock-tables --extended-insert $db"
            if [ "$compressed" -eq 1 ] ; then
-               $command = "$command | gzip -c"
+               debug "$command > ${target_dir}/${name_backup_file}.sql${ext}"
+               $command | gzip -c > "${target_dir}/${name_backup_file}.sql${ext}"
+           else
+               debug "$command > ${target_dir}/${name_backup_file}.sql${ext}"
+               $command > "${target_dir}/${name_backup_file}.sql${ext}"
            fi
-           debug "$command > ${target_dir}/${name_backup_file}.sql${ext}"
-           $command > "${target_dir}/${name_backup_file}.sql${ext}"
         fi
 
         IFS="	"