2c23edd1ee
Unfortunately, config files layout changes with NM version; therefore require >= 0.8.1-1. This should also prevent NM from messing with VIF interfaces on suspend/resume.
15 lines
436 B
Bash
Executable File
15 lines
436 B
Bash
Executable File
#!/bin/sh
|
|
FILE=/etc/NetworkManager/NetworkManager.conf
|
|
VIFMAC=mac:fe:ff:ff:ff:ff:ff
|
|
if ! grep -q ^plugins.*keyfile $FILE ; then
|
|
sed -i 's/^plugins.*$/&,keyfile/' $FILE
|
|
echo '[keyfile]' >> $FILE
|
|
fi
|
|
if ! grep -q ^unmanaged-devices $FILE ; then
|
|
sed -i 's/^\[keyfile\]$/\[keyfile\]\x0aunmanaged-devices='$VIFMAC/ $FILE
|
|
fi
|
|
if ! grep -q ^unmanaged-devices.*$VIFMAC $FILE ; then
|
|
sed -i 's/^unmanaged-devices.*$/&,'$VIFMAC/ $FILE
|
|
fi
|
|
exit 0
|