From 93dd8112da4096dc40a119f91287e016c55656cf Mon Sep 17 00:00:00 2001 From: Daniel Moerner Date: Tue, 28 Mar 2017 17:19:12 -0400 Subject: [PATCH] network: Properly handle comments in NetworkManager.conf (#2584) Qubes-specific options must be added in NetworkManager.conf, even if those lines are commented out by default. The problem is solved by using extended regular expressions. --- network/network-manager-prepare-conf-dir | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/network/network-manager-prepare-conf-dir b/network/network-manager-prepare-conf-dir index 04cb00b..bb27413 100755 --- a/network/network-manager-prepare-conf-dir +++ b/network/network-manager-prepare-conf-dir @@ -13,7 +13,7 @@ unmanaged_devices=mac:fe:ff:ff:ff:ff:ff #for mac in `xenstore-ls device/vif | grep mac | cut -d= -f2 | tr -d '" '`; do # unmanaged_devices="$unmanaged_devices;mac:$mac" #done -sed -i -e "s/^unmanaged-devices=.*/unmanaged-devices=$unmanaged_devices/" /etc/NetworkManager/NetworkManager.conf -sed -i -e "s/^plugins=.*/plugins=keyfile/" /etc/NetworkManager/NetworkManager.conf +sed -r -i -e "s/^#?unmanaged-devices=.*/unmanaged-devices=$unmanaged_devices/" /etc/NetworkManager/NetworkManager.conf +sed -r -i -e "s/^#?plugins=.*/plugins=keyfile/" /etc/NetworkManager/NetworkManager.conf exit 0