SilkyFalcon

Generation

linuxFri, 25 Nov 2022

Block specific ip with iptables by 1st agument and check if command has argument

if [ $# -eq 0 ] then echo "You must type an IP address!" else sudo iptables -A INPUT -s "$1" -j DROP echo "IP address $1 is now blocked!" fi

Questions about programming?Chat with your personal AI assistant