network-manager-prepare-conf-dir 864 B

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