diff --git a/fedora-44/init.sh b/fedora-44/init.sh index a2ff387..76a2047 100644 --- a/fedora-44/init.sh +++ b/fedora-44/init.sh @@ -58,7 +58,7 @@ NetIPConfigStatic() { netif="$(ip a | grep ens | head -n1 | cut -d: -f2)" netif=${netif:1} netip="${IPV4}" - netmask="255.255.255.0" + netmask="24" netgw="$(echo "${IPV4}" | cut -d. -f1-3).1" netdns="$(echo "${IPV4}" | cut -d. -f1-3).1" netip=$(whiptail --title "Network" --inputbox "IP" 0 30 "${netip}" 3>&1 1>&2 2>&3) @@ -70,7 +70,14 @@ NetIPConfigStatic() { if [ "$?" = "0" ] && [ "${netgw}" != "" ]; then netdns=$(whiptail --title "Network" --inputbox "DNS" 0 30 "${netdns}" 3>&1 1>&2 2>&3) if [ "$?" = "0" ] && [ "${netdns}" != "" ]; then - echo "Not implemented" + NETDEVICE=$(nmcli -t -f DEVICE connection show --active | head -n1) + NETNAME=$(nmcli -t -f NAME connection show --active | head -n1) + nmcli connection modify "${NETNAME}" \ + ipv4.method manual \ + ipv4.addresses "${netip}/${netmask}" \ + ipv4.gateway "${netgw}" \ + ipv4.dns "${netdns}" + nmcli device reapply "${NETDEVICE}" && nmcli connection up "${NETNAME}" fi fi fi