qubes_fix_nm_conf.sh 436 B

1234567891011121314
  1. #!/bin/sh
  2. FILE=/etc/NetworkManager/NetworkManager.conf
  3. VIFMAC=mac:fe:ff:ff:ff:ff:ff
  4. if ! grep -q ^plugins.*keyfile $FILE ; then
  5. sed -i 's/^plugins.*$/&,keyfile/' $FILE
  6. echo '[keyfile]' >> $FILE
  7. fi
  8. if ! grep -q ^unmanaged-devices $FILE ; then
  9. sed -i 's/^\[keyfile\]$/\[keyfile\]\x0aunmanaged-devices='$VIFMAC/ $FILE
  10. fi
  11. if ! grep -q ^unmanaged-devices.*$VIFMAC $FILE ; then
  12. sed -i 's/^unmanaged-devices.*$/&,'$VIFMAC/ $FILE
  13. fi
  14. exit 0