Browse Source

Fix network namespaces list regexp for MOS 10.0

Change-Id: I008cab960638bafa0152cbf6da39ec1c940c0ee5
Olivier Bourdon 2 years ago
parent
commit
8a2a86d679

+ 1
- 1
deployment_scripts/puppet/modules/plugin_zabbix_snmptrapd/files/initscripts/snmpd View File

@@ -62,7 +62,7 @@ test -x $TRAPD_BINARY || exit 0
62 62
 
63 63
 create_ns_if_not_exists() {
64 64
   [ -n "$1" ] || return 0
65
-  exists=`$IP_BINARY netns | egrep "^$1\$" | wc -l`
65
+  exists=`$IP_BINARY netns | egrep "^$1\$|^$1 " | wc -l`
66 66
   [ $exists -le 0 ] || return 0
67 67
   $IP_BINARY netns add "$1"
68 68
 }

+ 1
- 1
deployment_scripts/puppet/modules/plugin_zabbix_snmptrapd/files/initscripts/snmptrapd View File

@@ -54,7 +54,7 @@ pidfile=/var/run/snmptrapd.pid
54 54
 
55 55
 if [ "x$NS" != "x" ]; then
56 56
   cmd="/sbin/ip netns exec $NS $binary"
57
-  exists=`$IP_BINARY netns | egrep "^$1\$" | wc -l`
57
+  exists=`$IP_BINARY netns | egrep "^$1\$|^$1 " | wc -l`
58 58
   if [ $exists -le 0 ]; then
59 59
     /sbin/ip netns add $NS
60 60
   fi

Loading…
Cancel
Save