I'm not good at shell scripting but I want my BFD (bruteforce detection) to only add IP addresses to the Ban list and not hostnames.
So I'm trying to create a shellscript that does the following:
- If the argument is an IP address, it just outputs that IP address back
- If it's not (so if it is a hostname) it uses the "host" command to fetch the IP address and output it. Without the "hostname.ext has address" before it, offcourse.
However, I can't manage to do it :| And I know that there are linux people in here who can write this in about 10 seconds... Can anyone help me?