#! /usr/bin/bash
echo "Enter your new IP adress:"
read ip
echo "Enter your gateway:"
read gateway
echo "Enter your dns:"
read dns


cat << EOF > /etc/systemd/network/static.network
[Match]
Name=eth0
[Network]
Address=$ip/24
Gateway=$gateway
DNS=$dns
EOF

systemctl restart systemd-networkd
systemctl stop k3s
/opt/bin/k3s server --cluster-reset
systemctl start k3s