First commit
This commit is contained in:
commit
ea71a178e1
3167 files changed
+122366
No files matched your search
Executable
+37
@@ -0,0 +1,37 @@
|
||||
#!/bin/bash
|
||||
|
||||
#check if there is any parameter
|
||||
if [ "$#" -ne 1 ]; then
|
||||
echo "You must enter a source file."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
#check if file exists
|
||||
if ! test -f "$1"; then
|
||||
echo "$1 does not exists."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
#variables
|
||||
hashDir=data
|
||||
gameListDir=gamelists
|
||||
systemName="$(basename "$1" .html)"
|
||||
echo "Processing $systemName."
|
||||
tempFile1="${systemName}-1.tmp"
|
||||
tempFile2="${systemName}-2.tmp"
|
||||
hashList="./${hashDir}/${systemName}.hashlist"
|
||||
|
||||
# extract hashes from files on data/system folder
|
||||
|
||||
# if file exists, delete
|
||||
if test -f "${hashList}"; then
|
||||
rm "${hashList}"
|
||||
fi
|
||||
|
||||
# for every file in folder, do
|
||||
for i in ./${gameListDir}/$systemName/*; do
|
||||
# catch hash and append to file
|
||||
grep -E "[a-f0-9]{32}" -Eo $i >> ${hashList}
|
||||
echo "Parsing ${i} ..."
|
||||
done
|
||||
echo "Parsed $(wc -l < ${hashList}) hashes for $(find ${gameListDir}/${systemName} -type f | wc -l) games."
|
||||
Reference in new issue
Block a user