Last change
on this file since 105afb5 was
c5c522c,
checked in by Edwin Eefting <edwin@datux.nl>, 8 years ago
|
initial commit, transferred from cleaned syn3 svn tree
|
-
Property mode set to
100755
|
File size:
475 bytes
|
Line | |
---|
1 | #!/bin/bash |
---|
2 | |
---|
3 | IP=$1 |
---|
4 | |
---|
5 | check() |
---|
6 | { |
---|
7 | A=`echo $IP | cut -f1 -d.` |
---|
8 | B=`echo $IP | cut -f2 -d.` |
---|
9 | C=`echo $IP | cut -f3 -d.` |
---|
10 | D=`echo $IP | cut -f4 -d.` |
---|
11 | |
---|
12 | if [ "$A" -lt "1" -o "$A" -gt "255" ] || [ "$B" -lt "0" -o "$B" -gt "255" ] || [ "$C" -lt "0" -o "$C" -gt "255" ] || [ "$D" -lt "0" -o "$D" -gt "255" ]; then |
---|
13 | exit 1 |
---|
14 | fi |
---|
15 | } |
---|
16 | |
---|
17 | case $1 in |
---|
18 | *[^0-9.]*) exit 1 ;; |
---|
19 | *.*.*.*.*) exit 1 ;; |
---|
20 | [0-9]*.[0-9]*.[0-9]*.[0-9]*) check ;; |
---|
21 | *) exit 1 ;; |
---|
22 | esac |
---|
23 | |
---|
24 | exit 0 |
---|
Note: See
TracBrowser
for help on using the repository browser.