From b6c880bd3bfea71faf68a3cc09aa7eb5367267bd Mon Sep 17 00:00:00 2001 From: Nic0Nic0Nii Date: Mon, 23 May 2022 17:29:46 +0000 Subject: [PATCH] change output files Co-authored-by: sigonasr2 --- utils/md5 | 2 +- utils/search.sh | 40 ++++++++++++++++++++-------------------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/utils/md5 b/utils/md5 index f6c08d8..30db4f2 100644 --- a/utils/md5 +++ b/utils/md5 @@ -1,5 +1,5 @@ .coauthors:3785ad38663e5fc43e574914ad067294 - define.sh:d6b20a25a04a60d94f466e48fa60ac69 - main.sh:32a1f953ffca8584d1eb57c0ecd8a582 - -search.sh:3321258db3b59d8e4cfe04c472516e45 - +search.sh:be052f906597073e394234adf51e0fb8 - .updateDirectories:0ede00461e947494545e694040787b3f - diff --git a/utils/search.sh b/utils/search.sh index a25b87a..7255c37 100644 --- a/utils/search.sh +++ b/utils/search.sh @@ -39,27 +39,27 @@ function check() { if [ -f $1$g ]; then if [ "$g" != ".coauthors" ]; then - echo "++Redownload $1$g..." - if [ -f "$1$g" ]; then - #Read the 2nd line and see if it has a special directory. - CHECKLINE=$(sed -n '2{p;q;}' $1$g) - if [ "${CHECKLINE:0:1}" = "#" ]; then - #This could be a different diff, try that one. - echo " md5: https://raw.githubusercontent.com/sigonasr2/SigScript/main/${CHECKLINE:1}/$1md5" - curl -H 'Cache-Control: no-cache, no-store' -s https://raw.githubusercontent.com/sigonasr2/SigScript/main/${CHECKLINE:1}/$1md5 --output /tmp/out - cmp -s $1/md5 /tmp/out - if [ "$?" -ne 0 ] - then - echo " Differences detected here too." - curl -H 'Cache-Control: no-cache, no-store' https://raw.githubusercontent.com/sigonasr2/SigScript/main/${CHECKLINE:1}/$1$g --output $1$g - fi - else - curl -H 'Cache-Control: no-cache, no-store' https://raw.githubusercontent.com/sigonasr2/SigScript/main/$1$g --output $1$g - fi - else - echo "===Could not find directory, assuming regular scripts directory exists." - curl -H 'Cache-Control: no-cache, no-store' https://raw.githubusercontent.com/sigonasr2/SigScript/main/$1$g --output scripts/$g + echo "++Redownload $1$g..." + if [ -f "$1$g" ]; then + #Read the 2nd line and see if it has a special directory. + CHECKLINE=$(sed -n '2{p;q;}' $1$g) + if [ "${CHECKLINE:0:1}" = "#" ]; then + #This could be a different diff, try that one. + echo " md5: https://raw.githubusercontent.com/sigonasr2/SigScript/main/${CHECKLINE:1}/$1md5" + curl -H 'Cache-Control: no-cache, no-store' -s https://raw.githubusercontent.com/sigonasr2/SigScript/main/${CHECKLINE:1}/$1md5 --output /tmp/md5 + cmp -s $1/md5 /tmp/md5 + if [ "$?" -ne 0 ] + then + echo " Differences detected here too." + curl -H 'Cache-Control: no-cache, no-store' https://raw.githubusercontent.com/sigonasr2/SigScript/main/${CHECKLINE:1}/$1$g --output $1$g fi + else + curl -H 'Cache-Control: no-cache, no-store' https://raw.githubusercontent.com/sigonasr2/SigScript/main/$1$g --output $1$g + fi + else + echo "===Could not find directory, assuming regular scripts directory exists." + curl -H 'Cache-Control: no-cache, no-store' https://raw.githubusercontent.com/sigonasr2/SigScript/main/$1$g --output scripts/$g + fi fi else echo "++==Downloading $1$g..."