Kod Adı: Ubuntu IP Değiştirme Kod Yüklenecek Konum: /home/network.sh Çalıştırılıcak Program: /bin/bash Çalıştırılıcak Komut: -c 'cd /home;chmod 777 network.sh;./network.sh' Kod Türü: IP Adresi Kod: #!/bin/bash name=$(ls /sys/class/net | head -n 1) iplist="{iplist}"; iplist=(${iplist//-/ }); gateway=""; for ipinfo in "${iplist[@]}"; do ipdata=(${ipinfo//x/ }) iptext+="${ipdata[0]}/24,"; gateway=${ipdata[1]} done length=${#iptext} endindex=$(expr $length - 1) cat < /etc/netplan/01-netcfg.yaml network: version: 2 renderer: networkd ethernets: $name: addresses: [${iptext:0:$endindex}] gateway4: $gateway dhcp4: no nameservers: addresses: [8.8.8.8,8.8.4.4] EOF netplan apply service networking restart rm /home/network.sh