core-admin/common/qubes_fix_nm_conf.sh
Tomasz Sterna 01b7d9aafc Create needed NetworkManager.conf in netvm. #94
Also fixed qubes_fix_nm_conf.sh script.
2011-03-26 11:33:04 +01:00

17 lines
481 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
fi
if ! grep -q '^\[keyfile\]$' $FILE ; then
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