From bcca8fc5ab4ae5ee273514b696b321775066bcda Mon Sep 17 00:00:00 2001 From: root Date: Tue, 10 Feb 2015 10:14:22 +0100 Subject: [PATCH] Fix to support complete/dependent package --- check_rc_upgrade.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/check_rc_upgrade.sh b/check_rc_upgrade.sh index bf00c53..d1576f9 100755 --- a/check_rc_upgrade.sh +++ b/check_rc_upgrade.sh @@ -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"