]>
Commit | Line | Data |
---|---|---|
8b6d5b1d AF |
1 | --- _startklips.old 2008-09-07 00:50:40.000000000 +0200 |
2 | +++ _startklips 2008-09-07 00:50:42.000000000 +0200 | |
3 | @@ -146,23 +146,35 @@ | |
4 | ||
5 | # figure out ifconfig for interface | |
6 | addr= | |
7 | - eval `ifconfig $phys | | |
8 | - awk '$1 == "inet" && $2 ~ /^addr:/ && $NF ~ /^Mask:/ { | |
9 | - gsub(/:/, " ", $0) | |
10 | - print "addr=" $3 | |
11 | - other = $5 | |
12 | - if ($4 == "Bcast") | |
13 | - print "type=broadcast" | |
14 | - else if ($4 == "P-t-P") | |
15 | - print "type=pointopoint" | |
16 | - else if (NF == 5) { | |
17 | - print "type=" | |
18 | - other = "" | |
19 | - } else | |
20 | - print "type=unknown" | |
21 | - print "otheraddr=" other | |
22 | - print "mask=" $NF | |
23 | - }'` | |
24 | + eval `ip addr show $phys | awk '$3 ~ /BROADCAST|POINTOPOINT/ { | |
25 | + if ($3 ~ /BROADCAST/) | |
26 | + print "type=broadcast"; | |
27 | + else if ($3 ~ /POINTOPOINT/) | |
28 | + print "type=pointopoint"; | |
29 | + else { | |
30 | + print "type="; | |
31 | + } | |
32 | + }'` | |
33 | + | |
34 | + if [ "$type" == "broadcast" ]; then | |
35 | + eval `ip addr show $phys | awk '$1 == "inet" { gsub(/\//, " "); | |
36 | + print "addr=" $2; | |
37 | + print "mask=" $3; | |
38 | + print "otheraddr=" $5; | |
39 | + }'` | |
40 | + elif [ "$type" == "pointopoint" ]; then | |
41 | + eval `ip addr show $phys | awk '$1 == "inet" { gsub(/\//, " "); | |
42 | + print "addr=" $2; | |
43 | + print "mask=" $5; | |
44 | + print "otheraddr=" $4; | |
45 | + }'` | |
46 | + else | |
47 | + type="unknown" | |
48 | + otheraddr= | |
49 | + fi | |
50 | + | |
51 | + eval `whatmask /$mask | awk -F': ' '$1 ~ /^Netmask =/ { print "mask=" $2 }'` | |
52 | + | |
53 | if test " $addr" = " " | |
54 | then | |
55 | echo "unable to determine address of \`$phys'" | |
56 | @@ -171,7 +183,7 @@ | |
57 | if test " $type" = " unknown" | |
58 | then | |
59 | echo "\`$phys' is of an unknown type" | |
60 | - exit 1 | |
61 | + exit 1 | |
62 | fi | |
63 | if test " $omtu" != " " | |
64 | then |