From 18ab0b93fb40af8b14879663a933a55480b356e1 Mon Sep 17 00:00:00 2001 From: Matteo Rossini Date: Mon, 16 Oct 2017 19:49:16 +0200 Subject: [PATCH] Fixed checkrepos.sh when server response is 302 --- src/checkrepos.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/checkrepos.sh b/src/checkrepos.sh index 7f8ba20..ae3582d 100755 --- a/src/checkrepos.sh +++ b/src/checkrepos.sh @@ -116,10 +116,10 @@ for R in $REPOS;do if grep -q "200 OK" CHECKSUMS.md5.R;then [ $V ]&&echo -n "OK "||echo -n . if grep -q Content-Length: CHECKSUMS.md5.R;then - [ $V ]&&echo -n "$(grep Content-Length: CHECKSUMS.md5.R|awk '{print $2}'|sed 's/ //') bytes " + [ $V ]&&echo -n "$(grep Content-Length: CHECKSUMS.md5.R|tail -1|awk '{print $2}'|sed 's/ //') bytes " fi if grep -q Last-Modified: CHECKSUMS.md5.R;then - [ $V ]&&echo -n "($(grep Last-Modified: CHECKSUMS.md5.R|cut -f2- -d:|sed 's/ //') ) " + [ $V ]&&echo -n "($(grep Last-Modified: CHECKSUMS.md5.R|tail -1|cut -f2- -d:|sed 's/ //') ) " fi [ $V ]&&echo MD5=yes @@ -138,12 +138,12 @@ for R in $REPOS;do if grep -q "200 OK" PACKAGES.TXT.R;then [ $V ]&&echo -n "OK "||echo -n . if grep -q Content-Length: PACKAGES.TXT.R;then - [ $V ]&&echo -n "$(grep Content-Length: PACKAGES.TXT.R|awk '{print $2}'|sed 's/ //') bytes " - SIZE="$(grep Content-Length: PACKAGES.TXT.R|awk '{print $2}'|sed 's/ //')" + [ $V ]&&echo -n "$(grep Content-Length: PACKAGES.TXT.R|tail -1|awk '{print $2}'|sed 's/ //') bytes " + SIZE="$(grep Content-Length: PACKAGES.TXT.R|tail -1|awk '{print $2}'|sed 's/ //')" fi if grep -q Last-Modified: PACKAGES.TXT.R;then - [ $V ]&&echo -n "($(grep Last-Modified: PACKAGES.TXT.R|cut -f2- -d:|sed 's/ //') ) " - DATE="$(grep Last-Modified: PACKAGES.TXT.R|cut -f2- -d:|sed 's/^M//')" + [ $V ]&&echo -n "($(grep Last-Modified: PACKAGES.TXT.R|tail -1|cut -f2- -d:|sed 's/ //') ) " + DATE="$(grep Last-Modified: PACKAGES.TXT.R|tail -1|cut -f2- -d:|sed 's/^M//')" fi [ $V ]&&echo PACK=yes