summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuca Muscariello <muscariello@ieee.org>2019-10-08 07:03:54 +0000
committerGerrit Code Review <gerrit@fd.io>2019-10-08 07:03:54 +0000
commit1bc4aca90da898424da7609af59aec5ac4770f73 (patch)
tree76b3d763d8939c50194751b830b7b2f8ebbec47d
parent7896701a177d66f376172ab43df4b0c1d5d867a3 (diff)
parent513fd31d16e527ecebc86911bd33ee73d6d16f9f (diff)
Merge "[HICN-300] Improved script to search for "hicn {" in /etc/vpp/startup.conf"
-rw-r--r--hicn-plugin/scripts/post3
-rw-r--r--hicn-plugin/scripts/postinst3
2 files changed, 4 insertions, 2 deletions
diff --git a/hicn-plugin/scripts/post b/hicn-plugin/scripts/post
index 3cde599ca..dd0a9fbf5 100644
--- a/hicn-plugin/scripts/post
+++ b/hicn-plugin/scripts/post
@@ -1,7 +1,8 @@
#!/bin/bash
if [ -e /etc/vpp/startup.conf ]; then
- if ! grep -q "hicn" /etc/vpp/startup.conf; then
+ RESULTS=$(sed -n '/hicn[ ]*{/p' /etc/vpp/startup.conf | wc -l)
+ if [[ $RESULTS = 0 ]]; then
printf '\n hicn {
## Set PIT size. Default is 131 072 entries
# pit-size 500000
diff --git a/hicn-plugin/scripts/postinst b/hicn-plugin/scripts/postinst
index 012fc3571..d6d48509c 100644
--- a/hicn-plugin/scripts/postinst
+++ b/hicn-plugin/scripts/postinst
@@ -1,7 +1,8 @@
#!/bin/bash
if [ -e /etc/vpp/startup.conf ]; then
- if ! grep -q "hicn" /etc/vpp/startup.conf; then
+ RESULTS=$(sed -n '/hicn[ ]*{/p' /etc/vpp/startup.conf | wc -l)
+ if [[ $RESULTS = 0 ]]; then
printf '\n hicn {
## Set PIT size. Default is 131 072 entries
# pit-size 500000