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

104 lines
4.3 KiB

3 years ago
function search() {
FILES2=$(ls -A $1 2>/dev/null)
3 years ago
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" ] && [ $g != "filelist" ] && [ $g != ".package.files" ]; then
if [ $g != ".coauthors" ] && [ $g != "version_info" ]; then
SUM=$(md5sum < $1$g)
echo "$g:$SUM" >> $1md5
fi
echo "$g" >> $1filelist
3 years ago
else
echo " ignoring $g..."
3 years ago
fi
fi
done
}
function check() {
echo "Check $1"
FILES2=$(ls -A $1 2>/dev/null)
3 years ago
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
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"
if [ "$g" != "md5" ] && [ "$g" != "filelist" ]; then
if [ -f $1$g ];
then
if [ "$g" != ".coauthors" ] && [ "$g" != "version_info" ]; 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
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
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
fi
fi
done < /tmp/out
fi
fi
if [ -f "$1/filelist" ];
then
echo " filelist: https://raw.githubusercontent.com/sigonasr2/SigScript/main/$1filelist"
curl -H 'Cache-Control: no-cache, no-store' -s "https://raw.githubusercontent.com/sigonasr2/SigScript/main/$1filelist" --output /tmp/out
cmp -s $1/filelist /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"
if [ "$g" != "md5" ] && [ "$g" != "filelist" ]; then
3 years ago
if [ -f $1$g ];
then
if [ "$g" != ".coauthors" ] && [ "$g" != "version_info" ]; 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
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" --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" --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
}