„update_blocklist.sh“ ändern
This commit is contained in:
parent
9da31d7a71
commit
a9398b93eb
1 changed files with 4 additions and 6 deletions
|
@ -49,8 +49,6 @@ while read BLOCKED_IP
|
||||||
# Check if IP valid
|
# Check if IP valid
|
||||||
VALID_IPv4=$(echo "$BLOCKED_IP" | grep -Eo "^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$" | wc -l)
|
VALID_IPv4=$(echo "$BLOCKED_IP" | grep -Eo "^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$" | wc -l)
|
||||||
|
|
||||||
echo "$BLOCKED_IP"
|
|
||||||
|
|
||||||
if [[ $VALID_IPv4 -eq 1 ]]; then
|
if [[ $VALID_IPv4 -eq 1 ]]; then
|
||||||
# Convert IPv4 to IPv6 :)
|
# Convert IPv4 to IPv6 :)
|
||||||
IPv4=$(echo $BLOCKED_IP | sed 's/\./ /g')
|
IPv4=$(echo $BLOCKED_IP | sed 's/\./ /g')
|
||||||
|
@ -61,15 +59,15 @@ echo "$BLOCKED_IP"
|
||||||
countadded=$(( $countadded + 1 ))
|
countadded=$(( $countadded + 1 ))
|
||||||
if [[ $LOGLEVEL -eq 2 ]]; then
|
if [[ $LOGLEVEL -eq 2 ]]; then
|
||||||
echo "IP added to Database! --> $BLOCKED_IP"
|
echo "IP added to Database! --> $BLOCKED_IP"
|
||||||
# elif [[ $LOGLEVEL -eq 1 ]]; then
|
elif [[ $LOGLEVEL -eq 1 ]]; then
|
||||||
# echo -n "."
|
echo -n "."
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
countskipped=$(( $countskipped + 1 ))
|
countskipped=$(( $countskipped + 1 ))
|
||||||
if [[ $LOGLEVEL -eq 2 ]]; then
|
if [[ $LOGLEVEL -eq 2 ]]; then
|
||||||
echo "IP already in Database! --> $BLOCKED_IP"
|
echo "IP already in Database! --> $BLOCKED_IP"
|
||||||
# elif [[ $LOGLEVEL -eq 1 ]]; then
|
elif [[ $LOGLEVEL -eq 1 ]]; then
|
||||||
# echo -n "."
|
echo -n "."
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue