From ff47b0a8b82622ccd9cfcb5a684cb8f7c61507d7 Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Fri, 11 Jan 2013 01:28:48 +0100 Subject: [PATCH] vm/network: create NetworkManager config link only once --- network/network-manager-prepare-conf-dir | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/network/network-manager-prepare-conf-dir b/network/network-manager-prepare-conf-dir index 84a3635..bfb6dee 100755 --- a/network/network-manager-prepare-conf-dir +++ b/network/network-manager-prepare-conf-dir @@ -1,10 +1,11 @@ #!/bin/sh -if [ -d /etc/NetworkManager/system-connections ]; then +NM_CONFIG_DIR=/etc/NetworkManager/system-connections +if [ -d $NM_CONFIG_DIR -a ! -h $NM_CONFIG_DIR ]; then mkdir -p /rw/config/NM-system-connections - mv /etc/NetworkManager/system-connections/* /rw/config/NM-system-connections/ 2> /dev/null || true - rmdir /etc/NetworkManager/system-connections - ln -s /rw/config/NM-system-connections /etc/NetworkManager/system-connections + mv $NM_CONFIG_DIR/* /rw/config/NM-system-connections/ 2> /dev/null || true + rmdir $NM_CONFIG_DIR + ln -s /rw/config/NM-system-connections $NM_CONFIG_DIR fi exit 0