Update Container to python3

This commit is contained in:
TKE
2021-03-16 20:10:26 +01:00
parent 8a4bbc91bd
commit 0d374d6bdb
2 changed files with 13 additions and 10 deletions

View File

@@ -14,7 +14,7 @@ hashfile_name=$(cat /nsrl/nsrl.conf | grep 'hashfile_name' | cut -f2- -d= | grep
echo "hashfile_name=${hashfile_name}"
build_date=$(date +%Y%M%d_%H%M)
echo "build_date=${build_date}"
ls /nsrl/*.zip
#check if a zipfile was provided
if [ -f /nsrl/*.zip ]; then
zip_filename=$(ls /nsrl/*.zip | head -n1)
@@ -28,11 +28,12 @@ else
#Downloading and Hashing at the same time
zip_md5=$(wget -O - "${rds_url}" 2>/dev/null | tee "/nsrl/${zip_filename}" | md5sum | cut -f1 -d" ")
rds_version=$(wget -O - "${version_url}" 2>/dev/null | tee "/nsrl/.version" | head -n1 )
zip_filename=$(ls /nsrl/*.zip | head -n1)
fi
echo "[INFO] Unzip NSRL Database zip to /nsrl/ ..."
7z x -o/nsrl/ "/nsrl/${zip_filename}"
7z e "${zip_filename}" -o/nsrl/ NSRLFile.txt -r
echo "[INFO] Counting Hashes in /nsrl/${hashfile_name} ..."
#counting lines in hashfile without headline
@@ -40,7 +41,7 @@ let hash_count=$(cat "/nsrl/${hashfile_name}"|wc -l )-1
echo "[INFO] /nsrl/${hashfile_name} contains ${hash_count} Hashes"
echo "[INFO] Build bloomfilter from NSRL Database ..."
cd /nsrl && python /nsrl/build.py -e "${error_rate}" -n "${hash_count}"
cd /nsrl && python3 /nsrl/build.py -e "${error_rate}" -n "${hash_count}"
echo "[INFO] Listing created files ..."
ls -lah /nsrl
@@ -54,5 +55,4 @@ echo "build_date = ${build_date}" >> /nsrl/nsrl.conf
echo "zip_filename = ${zip_filename}" >> /nsrl/nsrl.conf
echo "zip_md5 = ${zip_md5}" >> /nsrl/nsrl.conf
echo "rds_version = ${rds_version}" >> /nsrl/nsrl.conf
echo "hash_count = ${hash_count}" >> /nsrl/nsrl.conf
cat /nsrl/nsrl.conf