This commit is contained in:
Your Name 2024-09-30 13:31:39 -06:00
parent 422a43466b
commit c46d519bd0

View File

@ -50,6 +50,7 @@ VIRT_BRIDGE="virbr0"
NFT='/usr/bin/nft' NFT='/usr/bin/nft'
NFT_CACHE='/tmp/nft.cache' NFT_CACHE='/tmp/nft.cache'
TMP_BLOCK=($(redis-cli --raw SMEMBERS tmp_block)) TMP_BLOCK=($(redis-cli --raw SMEMBERS tmp_block))
TRUST=($(redis-cli --raw SMEMBERS trust))
#Redis DB #Redis DB
# #
SAVED_BOTS=($(redis-cli --raw SMEMBERS bots)) SAVED_BOTS=($(redis-cli --raw SMEMBERS bots))
@ -335,6 +336,8 @@ research-ip() {
} }
importDB() { importDB() {
DATA=($(cat trust.txt))
for i in "${DATA[@]}"; do redis-cli SADD trust $i; done
DATA=($(cat safe.txt)) DATA=($(cat safe.txt))
for i in "${DATA[@]}"; do redis-cli SADD safe_traffic $i; done for i in "${DATA[@]}"; do redis-cli SADD safe_traffic $i; done
DATA=($(cat bots.txt)) DATA=($(cat bots.txt))
@ -362,6 +365,7 @@ exportDB() {
for i in "${CRAWLER_DB[@]}"; do echo $i >>crawlers.txt; done for i in "${CRAWLER_DB[@]}"; do echo $i >>crawlers.txt; done
for i in "${SAVED_BOTS[@]}"; do echo $i >>bots.txt; done for i in "${SAVED_BOTS[@]}"; do echo $i >>bots.txt; done
for i in "${SAFE_TRAFFIC[@]}"; do echo $i >>safe.txt; done for i in "${SAFE_TRAFFIC[@]}"; do echo $i >>safe.txt; done
for i in "${TRUST[@]}"; do echo $i >>trust.txt; done
} }
if [ "$1" = "start" ]; then if [ "$1" = "start" ]; then