A game highly inspired by Rabi-Ribi being developed using a custom-developed Sig game engine from the ground up with a proper game studio!
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
RabiClone/utils/search.sh

67 lines
2.3 KiB

3 years ago
function search() {
FILES2=$(ls -A $1)
for g in $FILES2
do
if [ -d $1$g ];
then
echo "$1$g is a directory"
search $1$g/
else
echo "$1$g is a file"
if [ $g != "md5" ]; then
SUM=$(md5sum < $1$g)
echo "$g:$SUM" >> $1md5
else
echo " md5 file, ignoring..."
fi
fi
done
}
function check() {
echo "Check $1"
FILES2=$(ls -A $1)
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/?$(date +%s)" --output /tmp/out
3 years ago
cmp -s $1/md5 /tmp/out
if [ "$?" -ne 0 ]
then
echo " Differences detected!"
cat /tmp/out
while IFS= read -r line
do
IFS=':' read -ra split <<< $line
g="${split[0]}"
echo "LINE -- $g"
3 years ago
if [ "$g" != "md5" ]; then
if [ -f $1$g ];
then
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/?$(date +%s)" --output $1$g
3 years ago
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/?$(date +%s)" --output $LANGUAGE/scripts/$g
3 years ago
fi
fi
else
echo "++==Downloading $1$g..."
curl -H 'Cache-Control: no-cache, no-store' "https://raw.githubusercontent.com/sigonasr2/SigScript/main/$1$g/?$(date +%s)" --output $1$g
3 years ago
fi
fi
done < /tmp/out
fi
fi
for g in $FILES2
do
if [ -d $1$g ];
then
echo "$1$g is a directory"
check $1$g/
fi
done
}