+

Fix to support complete/dependent package

root [2015-02-10 09:14:22]
Fix to support complete/dependent package
Filename
check_rc_upgrade.sh
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"
ViewGit