Fix to support complete/dependent package

This commit is contained in:
root 2015-02-10 10:14:22 +01:00
parent e0f4c3fdd7
commit bcca8fc5ab

View file

@ -106,13 +106,13 @@ for i in `seq 1 $MAX_CHECK`
do
tmpfile=`mktemp`
wget -q $CHECK_URL -O $tmpfile
newest=`cat $tmpfile|grep dlversion|grep Complete|head -n 1|sed 's/^.*: \([0-9\.]*\).*$/\1/'`
newest=`cat $tmpfile|grep 'downloads.sourceforge.net'|grep 'complete.tar.gz'|head -n 1|sed 's|^.*downloads.sourceforge.net/project/roundcubemail/roundcubemail/\([^/]*\)/roundcubemail-.*$|\1|'`
if [ -n "$newest" ]
then
[ $DEBUG -eq 1 ] && echo "Newest : $newest"
[ $NAGIOS -ne 1 ] && rm -f $CACHE_FAILED > /dev/null 2>&1
DOWNLOAD_URL=`cat $tmpfile|grep "$newest"|grep "tar.gz"|head -1|sed 's/.* href="[ \t]*\([^"]*\)[ \t]*" .*$/\1/'`
DOWNLOAD_URL=`cat $tmpfile|grep "$newest"|grep "\-complete.tar.gz"|head -1|sed 's/.* href="[ \t]*\([^"]*\)[ \t]*" .*$/\1/'`
[ $DEBUG -eq 1 ] && echo "Download URL : $DOWNLOAD_URL"
[ ! -n "$DOWNLOAD_URL" ] && DOWNLOAD_URL="$CHECK_URL" && [ $DEBUG -eq 1 ] && echo "Use check URL as download URL : $DOWNLOAD_URL"