ubuntu20 设置IP脚本
自己虚拟机设置IP的脚本
#!/bin/bash if [ -z "$1" ]; then echo "没有传入参数" exit else echo "第一个参数是: $1" fi echo "network: ethernets: enp0s3: dhcp4: no addresses: [192.168.0.107/24] gateway4: 192.168.0.1 nameservers: addresses: [192.168.0.1, 114.114.114.114] version: 2" > /etc/netplan/00-installer-config.yaml sed -i "s|107|$1|g" /etc/netplan/00-installer-config.yaml netplan apply
浙公网安备 33010602011771号