network-manager-prepare-conf-dir 758 B

12345678910111213141516171819
  1. #!/bin/sh
  2. NM_CONFIG_DIR=/etc/NetworkManager/system-connections
  3. if [ -d $NM_CONFIG_DIR -a ! -h $NM_CONFIG_DIR ]; then
  4. mkdir -p /rw/config/NM-system-connections
  5. mv $NM_CONFIG_DIR/* /rw/config/NM-system-connections/ 2> /dev/null || true
  6. rmdir $NM_CONFIG_DIR
  7. ln -s /rw/config/NM-system-connections $NM_CONFIG_DIR
  8. fi
  9. # Do not manage xen-provided network devices
  10. unmanaged_devices=mac:fe:ff:ff:ff:ff:ff
  11. #for mac in `xenstore-ls device/vif | grep mac | cut -d= -f2 | tr -d '" '`; do
  12. # unmanaged_devices="$unmanaged_devices;mac:$mac"
  13. #done
  14. sed -i -e "s/^unmanaged-devices=.*/unmanaged-devices=$unmanaged_devices/" /etc/NetworkManager/NetworkManager.conf
  15. sed -i -e "s/^plugins=.*/plugins=keyfile/" /etc/NetworkManager/NetworkManager.conf
  16. exit 0