Fix bug.
This commit is contained in:
parent
01c7540989
commit
956c2a8262
|
@ -1,4 +1,15 @@
|
|||
#!/usr/bin/bash
|
||||
if [[ "$1" == "--status" ]]; then
|
||||
default_route=`ip -o -4 route show to default`
|
||||
if [[ -z "$default_route" ]]; then
|
||||
echo "No default network interface detected!"
|
||||
else
|
||||
interface=`echo $default_route|awk '{print $5}'|xargs|awk '{print $1}'`
|
||||
ipv4=`echo $default_route|awk '{print $9}'|xargs|awk '{print $1}'`
|
||||
echo "network interface: $interface"
|
||||
echo "IPv4: $ipv4"
|
||||
fi
|
||||
fi
|
||||
if [[ -z "$(which netplan)" ]]; then
|
||||
echo "Your system is not support netplan!"
|
||||
echo "Please generate your network config!"
|
||||
|
@ -11,6 +22,9 @@ else
|
|||
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
|
||||
configure_netplan_py=`curl http://gitlab.tp.rulingcom.com/erictyl/install_r45_on_ubuntu_1804lts_doc/-/raw/master/configure_netplan.py`
|
||||
if [[ ! -z "$configure_netplan_py" ]]; then
|
||||
echo "$configure_netplan_py" > configure_netplan.py
|
||||
fi
|
||||
sudo python3 configure_netplan.py "$netplan_config_file"
|
||||
fi
|
Loading…
Reference in New Issue