mirror of
https://github.com/leitbogioro/Tools.git
synced 2024-11-15 21:54:40 +08:00
Update InstallNET.sh
This commit is contained in:
parent
d7093c3444
commit
f9266b67a5
1 changed files with 5 additions and 0 deletions
|
@ -697,6 +697,11 @@ function getInterface(){
|
|||
done
|
||||
else
|
||||
for Count in "/etc/network/" "/run/network/"; do
|
||||
# In some debian templates like DigitalOcean, there are three directions deposing network configurations:
|
||||
# /etc/network/interfaces
|
||||
# /etc/network/interfaces.d/50-cloud-init
|
||||
# /etc/network/cloud-interfaces-template
|
||||
# We should filter the largest file, the correct configuration is just there.
|
||||
NetCfgWhole=`grep -wrl "network" | grep -wrl "iface" | grep -wrl "lo" | grep -wrl "inet\|inte6" | grep -wrl "dhcp\|static" $Count* | grep -v "if-*" | grep -v "state" | sort -hr | head -1`
|
||||
if [[ "$NetCfgWhole" != "" ]]; then
|
||||
NetCfgFile=`echo $NetCfgWhole | awk -F/ '{print $NF}'`
|
||||
|
|
Loading…
Reference in a new issue