~vcs-imports/ipfire/ipfire-2.x

« back to all changes in this revision

Viewing changes to src/patches/openswan-2.6.16-startklips-1.patch

  • Committer: Daniel Glanzmann
  • Date: 2008-09-26 17:05:28 UTC
  • mto: (1394.1.12)
  • mto: This revision was merged to the branch mainline in revision 1401.
  • Revision ID: git-v1:19ac4d1b6e234e1391b3d406381e3b74e92c40dd
added new useragent thunderbird

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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