From a4cabe0cf190582e2b872ca04858786924663628 Mon Sep 17 00:00:00 2001 From: Feng Pan Date: Fri, 27 May 2016 20:53:01 -0400 Subject: Fix PREFIX parsing of ifcfg file Make sure we only get number portion of PREFIX in ifcfg file, this avoids getting potentially the double quotes around the prefix. JIRA: APEX-163 Change-Id: Ic251a3a92bf4d318bb41114e15911f5e51dd2cde Signed-off-by: Feng Pan --- lib/common-functions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/common-functions.sh') diff --git a/lib/common-functions.sh b/lib/common-functions.sh index dfac008e..d01f7918 100644 --- a/lib/common-functions.sh +++ b/lib/common-functions.sh @@ -154,7 +154,7 @@ function detach_interface_from_ovs { if_dns2=$(sed -n 's/^DNS2=\(.*\)$/\1/p' ${net_path}/ifcfg-${bridge}) if [ -z "$if_mask" ]; then - if_prefix=$(sed -n 's/^PREFIX=\(.*\)$/\1/p' ${net_path}/ifcfg-${bridge}) + if_prefix=$(sed -n 's/^PREFIX=[^0-9]*\([0-9][0-9]*\)[^0-9]*$/\1/p' ${net_path}/ifcfg-${bridge}) if_mask=$(prefix2mask ${if_prefix}) fi -- cgit 1.2.3-korg