Validating an ip address in a bash script