[Swan] awk error when starting 3.10 with Debian 7

Muenz, Michael m.muenz at spam-fetish.org
Thu Sep 4 14:50:51 EEST 2014


Am 03.09.2014 um 21:44 schrieb Paul Wouters:
> could you add -u -v and -e to the initscript and see if you can pinpoint
> the problem?
>
> initsystems/sysvinit/init.debian.in has not been changed, so I suspect
> something was updated in the debian/ directory.
>
> Paul
>

bash -x /usr/local/libexec/ipsec/_stackmanager start

+ awk '$1 == "inet" || ($1 == "inet6" && !/ dynamic/) {
                     cmd = "ip addr add"
                     if ($1 == "inet")
                         sub(" [^ ]+:[^ ]+"," ")
                     sub("secondary","","")
                     sub("/.*","",$2)
                     sub("dynamic","")
                     for (i = 2; i < NF; i++) {
                         if ($i == "brd" || $i == "peer" || $i == 
"secondary")
                             i++
                         else
                             cmd = cmd " " $i
                     }
                     if ($NF != phys)
                         cmd = cmd " " $NF
                     cmd = cmd " dev " virt ">/dev/null 2>/dev/null"
                     system(cmd)
                 }' phys=eth0 virt=ipsec0
awk: line 5: syntax error at or near


A diff of _stackamanger between 3.9. and 3.10 shows me:

@@ -361,13 +361,14 @@
             ipsec tncfg --attach --virtual ${virt} --physical ${phys}

             # configure all the IPv4/IPv6 addresses (including 
point-to-point)
-           ip addr show dev ${phys} | \
+           ip addr show dev ${phys} label ${phys} | \
                 awk '$1 == "inet" || ($1 == "inet6" && !/ dynamic/) {
-               cmd = "ip addr add"
-               if ($1 == "inet")
-                   sub(" [^ ]+:[^ ]+"," ",$0)
+                   cmd = "ip addr add"
+                   if ($1 == "inet")
+                       sub(" [^ ]+:[^ ]+"," ")
+                   sub("secondary","","")
                     sub("/.*","",$2)
-                   sub("dynamic","",$0)
+                   sub("dynamic","")
                     for (i = 2; i < NF; i++) {
                         if ($i == "brd" || $i == "peer" || $i == 
"secondary")
                             i++
@@ -376,9 +377,9 @@
                     }
                     if ($NF != phys)
                         cmd = cmd " " $NF
-                       cmd = cmd " dev " virt ">/dev/null 2>/dev/null"
-                       system(cmd)
-                       }' phys=${phys} virt=${virt}
+                   cmd = cmd " dev " virt ">/dev/null 2>/dev/null"
+                   system(cmd)
+               }' phys=${phys} virt=${virt}
             ip link set up dev ${virt}

             if [ "${overridemtu}" != "" ]; then


I'm not a coder, don't know where there's a debian specific error.

Michael

-- 
www.muenz-it.de
- Cisco, Linux, Networks



More information about the Swan mailing list