initial commit
This commit is contained in:
11
valid-ip.sh
Normal file
11
valid-ip.sh
Normal file
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
# https://stackoverflow.com/questions/13777387/check-for-ip-validity
|
||||
function validip () {
|
||||
ip=$1
|
||||
if [ -z $ip ] || ! [[ $ip =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
Reference in New Issue
Block a user