Fix for Network Manager

This commit is contained in:
Ivan Jurišić 2024-04-24 11:37:01 +02:00
parent 3cb25d344d
commit cd6acd3a12

View File

@ -39,6 +39,18 @@ choice() {
done
}
fix_net() {
nf="/etc/network/interfaces"
ifs=($(ip addr | grep -E ':\s.*?:' | cut -d ":" -f 2 | tr -d " "))
for value in "${ifs[@]}"
do
sed -i 's/^[^#]*'.$value.'*/#&/' $nf
done
systemctl restart networking.service
systemctl restart NetworkManager.service
systemctl restart NetworkManager-wait-online.service
}
#### Main
check_root
@ -81,3 +93,7 @@ if choice 2>/dev/null; then
$APT_INST $PKG_FIREFOX $PKG_NET
fi
echo -ne "\nYou want to run fix_net function? "
if choice 2>/dev/null; then
fix_net
fi