Added -j parameter

This commit is contained in:
Benjamin Renard 2013-07-03 09:38:32 +02:00
parent 436638427a
commit 04a82c5a72

View file

@ -18,16 +18,18 @@ GROUP=www-data
DEBUG=0
UPGRADE=0
EXTRACT=0
JUST_DISP=0
function usage() {
echo "Usage : $0 [-v] [-d] [-u]"
echo " -v Verbose mode"
echo " -d Download new release"
echo " -u Upgrade installation"
echo " -j Just display current stable version"
echo " -h Display this help"
}
while getopts ":dvhu" opt; do
while getopts ":dvhuj" opt; do
case $opt in
v)
DEBUG=1
@ -41,6 +43,9 @@ while getopts ":dvhu" opt; do
DEBUG=1
EXTRACT=1
;;
j)
JUST_DISP=1
;;
h)
usage
exit 0
@ -63,11 +68,6 @@ done
[ -f "$0.local" ] && source "$0.local" && [ $DEBUG -eq 1 ] && echo "Import local config file : $0.local"
current=`egrep "define.*RCMAIL_VERSION" $RC_HOME/program/include/iniset.php|sed "s/define('.*', '\([^']*\)'.*$/\1/"`
current="`echo $current|sed 's/-rc$//'`"
current="`echo $current|sed 's/-beta$//'`"
[ $DEBUG -eq 1 ] && echo "Current : $current"
for i in `seq 1 $MAX_CHECK`
do
tmpfile=`mktemp`
@ -111,7 +111,13 @@ do
[ $DEBUG -eq 1 ] && echo "Check failed ($i/$MAX_CHECK) : Sleep $SLEEP_ON_FAILED second before try again ..."
sleep $SLEEP_ON_FAILED
done
[ $JUST_DISP -eq 1 ] && echo -e "Current stable version : $newest\nDownload URL : $DOWNLOAD_URL" && exit 0
current=`egrep "define.*RCMAIL_VERSION" $RC_HOME/program/include/iniset.php|sed "s/define('.*', '\([^']*\)'.*$/\1/"`
current="`echo $current|sed 's/-rc$//'`"
current="`echo $current|sed 's/-beta$//'`"
[ $DEBUG -eq 1 ] && echo "Current : $current"
if [ "$newest" != "$current" ]
then