Commit a75f51da authored by Igor Pecovnik's avatar Igor Pecovnik
Browse files

More adjustement for Network manager

parent ddfa0f85
......@@ -200,7 +200,9 @@ function jobs ()
fi
else
if [[ -n $(LC_ALL=C nmcli device status | grep $DEFAULT_ADAPTER | grep connected) ]]; then
nmcli connection delete uuid $(LC_ALL=C nmcli -f UUID,DEVICE connection show | grep $DEFAULT_ADAPTER | awk '{print $1}')
nmcli connection delete uuid $(LC_ALL=C nmcli -f UUID,DEVICE connection show | grep $DEFAULT_ADAPTER | awk '{print $1}') >/dev/null 2>&1
nmcli con add con-name "Armbian ethernet" type ethernet ifname $DEFAULT_ADAPTER >/dev/null 2>&1
nmcli con up "Armbian ethernet" >/dev/null 2>&1
else
create_if_config "$DEFAULT_ADAPTER" "$DEFAULT_ADAPTER" "dynamic" > /etc/network/interfaces
fi
......
......@@ -260,15 +260,14 @@ exec 3>&1
read -r address;read -r netmask;read -r gateway
if [[ $? = 0 ]]; then
localuuid=$(LC_ALL=C nmcli -f UUID,DEVICE connection show | grep $1 | awk '{print $1}')
nmcli con mod $localuuid ipv4.method manual ipv4.addresses "$address/$netmask"
nmcli con mod $localuuid ipv4.method manual ipv4.gateway "$gateway"
nmcli con mod $localuuid ipv4.dns "8.8.8.8,$gateway"
nmcli c down $localuuid
nmcli con mod $localuuid ipv4.method manual ipv4.addresses "$address/$netmask" >/dev/null 2>&1
nmcli con mod $localuuid ipv4.method manual ipv4.gateway "$gateway" >/dev/null 2>&1
nmcli con mod $localuuid ipv4.dns "8.8.8.8,$gateway" >/dev/null 2>&1
nmcli con down $localuuid >/dev/null 2>&1
sleep 2
nmcli c up $localuuid
nmcli con up $localuuid >/dev/null 2>&1
fi
}
exit
}
......@@ -639,7 +638,7 @@ function select_default_interface ()
for i in "${ADAPTER[@]}"
do
local IPADDR=$(ip -4 addr show dev ${i[0]} | awk '/inet/ {print $2}' | cut -d'/' -f1)
LIST+=( "${i[0]//[[:blank:]]/}" "${IPADDR}" )
[[ -n $IPADDR && $IPADDR != "172.24.1.1" ]] && LIST+=( "${i[0]//[[:blank:]]/}" "${IPADDR}" )
done
LIST_LENGHT=$((${#LIST[@]}/2));
if [ "$LIST_LENGHT" -eq 0 ]; then
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment