diff options
author | Feng Pan <fpan@redhat.com> | 2016-05-27 20:53:01 -0400 |
---|---|---|
committer | Feng Pan <fpan@redhat.com> | 2016-05-27 20:53:01 -0400 |
commit | a4cabe0cf190582e2b872ca04858786924663628 (patch) | |
tree | d306f42a5b38ea9191e37f74da6aff462d6dc0c0 /lib | |
parent | dd0329db043514ea9f89630060712323a773f73a (diff) |
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 <fpan@redhat.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/common-functions.sh | 2 |
1 files changed, 1 insertions, 1 deletions
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 |