Added -j parameter
Benjamin Renard

Benjamin Renard commited on 2013-07-03 07:38:32
Showing 1 changed files, with 12 additions and 6 deletions.

... ...
@@ -18,16 +18,18 @@ GROUP=www-data
18 18
 DEBUG=0
19 19
 UPGRADE=0
20 20
 EXTRACT=0
21
+JUST_DISP=0
21 22
 
22 23
 function usage() {
23 24
 	echo "Usage : $0 [-v] [-d] [-u]"
24 25
 	echo "  -v   Verbose mode"
25 26
 	echo "  -d   Download new release"
26 27
 	echo "  -u   Upgrade installation"
28
+	echo "  -j   Just display current stable version"
27 29
 	echo "  -h   Display this help"
28 30
 }
29 31
 
30
-while getopts ":dvhu" opt; do
32
+while getopts ":dvhuj" opt; do
31 33
 	case $opt in
32 34
 		v)
33 35
 			DEBUG=1
... ...
@@ -41,6 +43,9 @@ while getopts ":dvhu" opt; do
41 43
 			DEBUG=1
42 44
 			EXTRACT=1
43 45
 		;;
46
+		j)
47
+			JUST_DISP=1
48
+		;;
44 49
 		h)
45 50
 			usage
46 51
 			exit 0
... ...
@@ -63,11 +68,6 @@ done
63 68
 
64 69
 [ -f "$0.local" ] && source "$0.local" && [ $DEBUG -eq 1 ] && echo "Import local config file : $0.local"
65 70
 
66
-current=`egrep "define.*RCMAIL_VERSION" $RC_HOME/program/include/iniset.php|sed "s/define('.*', '\([^']*\)'.*$/\1/"`
67
-current="`echo $current|sed 's/-rc$//'`"
68
-current="`echo $current|sed 's/-beta$//'`"
69
-[ $DEBUG -eq 1 ] && echo "Current : $current"
70
-
71 71
 for i in `seq 1 $MAX_CHECK`
72 72
 do
73 73
 	tmpfile=`mktemp`
... ...
@@ -111,7 +111,13 @@ do
111 111
 	[ $DEBUG -eq 1 ] && echo "Check failed ($i/$MAX_CHECK) : Sleep $SLEEP_ON_FAILED second before try again ..."
112 112
 	sleep $SLEEP_ON_FAILED
113 113
 done
114
+[ $JUST_DISP -eq 1 ] && echo -e "Current stable version : $newest\nDownload URL : $DOWNLOAD_URL" && exit 0
114 115
 
116
+current=`egrep "define.*RCMAIL_VERSION" $RC_HOME/program/include/iniset.php|sed "s/define('.*', '\([^']*\)'.*$/\1/"`
117
+current="`echo $current|sed 's/-rc$//'`"
118
+current="`echo $current|sed 's/-beta$//'`"
119
+
120
+[ $DEBUG -eq 1 ] && echo "Current : $current"
115 121
 if [ "$newest" != "$current" ]
116 122
 then
117 123
 
118 124