Move redownload logic to accomplish before recursing directories

main
sigonasr2, Sig, Sigo 3 years ago
parent cfcf834362
commit e1518fbf86
  1. 2
      utils/md5
  2. 19
      utils/search.sh

@ -1,3 +1,3 @@
5e7a21b710475f173906085c01bd2205 - 5e7a21b710475f173906085c01bd2205 -
548480c89fb8d6668a83ee9e534eb2dd - 548480c89fb8d6668a83ee9e534eb2dd -
03061acd7af07b0d1295509234ff99b7 - d51f3526991522d890ca2ebd3f735b75 -

@ -20,7 +20,6 @@ function search() {
function check() { function check() {
echo "Check $1" echo "Check $1"
FILES2=$(ls $1) FILES2=$(ls $1)
REDOWNLOAD=false
if [ -f "$1/md5" ]; if [ -f "$1/md5" ];
then then
echo " md5: https://raw.githubusercontent.com/sigonasr2/SigScript/main/$1md5" echo " md5: https://raw.githubusercontent.com/sigonasr2/SigScript/main/$1md5"
@ -29,17 +28,10 @@ function check() {
if [ "$DIFF" != "" ] if [ "$DIFF" != "" ]
then then
echo " Differences detected!" echo " Differences detected!"
REDOWNLOAD=true
fi
fi
for g in $FILES2 for g in $FILES2
do do
if [ -d $1$g ]; if [ -f $1$g ];
then then
echo "$1$g is a directory"
check $1$g/
else
if [ "$REDOWNLOAD" = "true" ]; then
echo "++Redownload $1$g..." echo "++Redownload $1$g..."
if [ -f "$1$g" ]; then if [ -f "$1$g" ]; then
#Read the 2nd line and see if it has a special directory. #Read the 2nd line and see if it has a special directory.
@ -54,6 +46,15 @@ function check() {
curl https://raw.githubusercontent.com/sigonasr2/SigScript/main/$1$g --output scripts/$g curl https://raw.githubusercontent.com/sigonasr2/SigScript/main/$1$g --output scripts/$g
fi fi
fi fi
done
fi
fi
for g in $FILES2
do
if [ -d $1$g ];
then
echo "$1$g is a directory"
check $1$g/
fi fi
done done
} }
Loading…
Cancel
Save