Change order for download feature
root

root commited on 2011-02-10 11:09:08
Showing 1 changed files, with 14 additions and 11 deletions.

... ...
@@ -10,10 +10,10 @@ MAX_CHECK=10
10 10
 MAX_FAILED=3
11 11
 SLEEP_ON_FAILED=10
12 12
 CHECK_URL=http://www.roundcube.net/download
13
+DOWNLOAD=0
13 14
 DOWNLOAD_DIR=$RC_HOME/../upstream
14 15
 
15 16
 DEBUG=0
16
-DOWNLOAD=0
17 17
 
18 18
 function usage() {
19 19
 	echo "Usage : $0 [-v] [-d]"
... ...
@@ -102,27 +102,30 @@ done
102 102
 
103 103
 if [ "$newest" != "$current" ]
104 104
 then
105
-	tmp=`mktemp`
106
-	echo "New RoundCude release" > $tmp
107
-	echo "=====================" >> $tmp
108
-	echo "Current : $current" >> $tmp
109
-	echo "Newest : $newest" >> $tmp
110
-	echo >> $tmp
111
-	echo "Download URL : $DOWNLOAD_URL" >> $tmp
112 105
 
113 106
 	if [ $DOWNLOAD -eq 1 ]
114 107
 	then
115 108
 		if [ -d "$DOWNLOAD_DIR" ]
116 109
 		then
117 110
 			cd "$DOWNLOAD_DIR"
118
-			[ $DEBUG -eq 1 ] && echo "Download new release in $( pwd )/roundcubemail-$newest.tar.gz"
119
-			wget -q -O "roundcubemail-$newest.tar.gz" "$DOWNLOAD_URL"
120
-			echo "Download file : $( pwd )/roundcubemail-$newest.tar.gz" >> $tmp
111
+			DOWNLOAD_FILE="$( pwd )/roundcubemail-$newest.tar.gz"
112
+			[ $DEBUG -eq 1 ] && echo "Download new release in $DOWNLOAD_FILE"
113
+			wget -q -O "$DOWNLOAD_FILE" "$DOWNLOAD_URL"
121 114
 		else
122 115
 			echo "[WARNING] Le dossier de telechargement n'existe pas ($DOWNLOAD_DIR)."
123 116
 		fi
124 117
 	fi
125 118
 
119
+	tmp=`mktemp`
120
+	echo "New RoundCude release" > $tmp
121
+	echo "=====================" >> $tmp
122
+	echo "Current : $current" >> $tmp
123
+	echo "Newest : $newest" >> $tmp
124
+	echo >> $tmp
125
+	echo "Download URL : $DOWNLOAD_URL" >> $tmp
126
+	[ -n "$DOWNLOAD_FILE" -a -f "$DOWNLOAD_FILE" ] && echo "Download file : $( pwd )/roundcubemail-$newest.tar.gz" >> $tmp
127
+
128
+	
126 129
 	M=0
127 130
 	if [ -f $CACHE ]
128 131
 	then
129 132