Guys, who can tell me what's wrong? Created a bash script to automatically generate an ip pool in nethash format (subnets). But at the output, the list is obtained both with individual ip and with subnets. Example 184.108.40.206/31 220.127.116.11/28 18.104.22.168 22.214.171.124 ...
I don't understand why separate ip's are formed as well, because the initial loaded list only contains subnets.
#!/bin/bash echo "### Blocking Microsoft ###" # Delete the list if it already exists ipset -X blacklist #Creating a new list ipset -N blacklist nethash # Download the files of the countries we are interested in and merge them into one list wget -O microsoftIPv4-agrig.zone https://raw.githubusercontent.com/lord-alfred/ipranges/main/microsoft/ipv4.txt echo -n "Uploading blacklist to IPSET" # Read the list of networks and add them to ipset line by line list=$(cat microsoftIPv4-agrig.zone) for ipnet in $list do ipset -A blacklist $ipnet done echo "completed"
- linux : Forward client traffic through a different interface and forward the port
- linux : Is it possible to check the result of the execution of someone else's script?
- linux : Grep Number of matches in specific files
- linux : Bash -Put the transfer of the line after the first word
- How to read the Linux environment variable
- linux : Bash script to copy files to a specific expansion and change of the upper case to the lower
- Performing a Python script from another python script with a visual component
- linux : Create a bash script which groups files and searches the last
- linux : How to change the sound in the Ubuntu terminal?