|
|
|
@ -24,7 +24,7 @@ function check() { |
|
|
|
|
if [ -f "$1/md5" ]; |
|
|
|
|
then |
|
|
|
|
echo " md5: https://raw.githubusercontent.com/sigonasr2/SigScript/main/$1md5" |
|
|
|
|
curl -H 'Cache-Control: no-cache, no-store' -s https://raw.githubusercontent.com/sigonasr2/SigScript/main/$1md5 --output /tmp/out |
|
|
|
|
curl -H 'Cache-Control: no-cache, no-store' -s "https://raw.githubusercontent.com/sigonasr2/SigScript/main/$1md5" --output /tmp/out |
|
|
|
|
cmp -s $1/md5 /tmp/out |
|
|
|
|
if [ "$?" -ne 0 ] |
|
|
|
|
then |
|
|
|
@ -34,35 +34,22 @@ function check() { |
|
|
|
|
do |
|
|
|
|
IFS=':' read -ra split <<< $line |
|
|
|
|
g="${split[0]}" |
|
|
|
|
echo "LINE -- $g" |
|
|
|
|
if [ "$g" != "md5" ]; then |
|
|
|
|
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 |
|
|
|
|
if [ "$g" != ".coauthors" ]; then |
|
|
|
|
echo "++Redownload $1$g..." |
|
|
|
|
if [ -f "$1$g" ]; then |
|
|
|
|
curl -H 'Cache-Control: no-cache, no-store' "https://raw.githubusercontent.com/sigonasr2/SigScript/main/$1$g" --output $1$g |
|
|
|
|
else |
|
|
|
|
curl -H 'Cache-Control: no-cache, no-store' https://raw.githubusercontent.com/sigonasr2/SigScript/main/$1$g --output $1$g |
|
|
|
|
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 $LANGUAGE/scripts/$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..." |
|
|
|
|
curl -H 'Cache-Control: no-cache, no-store' https://raw.githubusercontent.com/sigonasr2/SigScript/main/$1$g --output $1$g |
|
|
|
|
curl -H 'Cache-Control: no-cache, no-store' "https://raw.githubusercontent.com/sigonasr2/SigScript/main/$1$g" --output $1$g |
|
|
|
|
fi |
|
|
|
|
fi |
|
|
|
|
done < /tmp/out |
|
|
|
|