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

Want to kickstart your project?Use the new AI Studio to create your code