install_r45_on_ubuntu_1804l.../configure_netplan.sh

16 lines
807 B
Bash
Raw Normal View History

2022-08-25 06:21:42 +00:00
#!/usr/bin/bash
if [[ -z "$(which netplan)" ]]; then
echo "Your system is not support netplan!"
echo "Please generate your network config!"
else
netplan_configs_count=`ls /etc/netplan/*.yaml|wc -l`
netplan_config_file=""
if [[ "$netplan_configs_count" == "0" ]]; then
netplan_config_file="/etc/netplan/00-installer-config.yaml"
sudo wget http://gitlab.tp.rulingcom.com/erictyl/install_r45_on_ubuntu_1804lts_doc/-/raw/master/default_netplan-config.yaml -O $netplan_config_file
else
netplan_config_file=`ls /etc/netplan/*.yaml|xargs|awk '{print $1}'`
fi
wget http://gitlab.tp.rulingcom.com/erictyl/install_r45_on_ubuntu_1804lts_doc/-/raw/master/configure_netplan.py -O configure_netplan.py
sudo python3 configure_netplan.py "$netplan_config_file"
fi