Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Config
Commits
5e54adf4
Unverified
Commit
5e54adf4
authored
Jul 20, 2018
by
Gauthier Provost
Committed by
GitHub
Jul 20, 2018
Browse files
Update debian-config-functions-network
Allow to chose a default interface that doesn't have an IP address yet. Issue #26
parent
b72ddca4
Changes
1
Hide whitespace changes
Inline
Side-by-side
debian-config-functions-network
View file @
5e54adf4
...
@@ -556,7 +556,7 @@ function select_default_interface ()
...
@@ -556,7 +556,7 @@ function select_default_interface ()
for
i
in
"
${
ADAPTER
[@]
}
"
for
i
in
"
${
ADAPTER
[@]
}
"
do
do
local
IPADDR
=
$(
ip
-4
addr show dev
${
i
[0]
}
|
awk
'/inet/ {print $2}'
|
cut
-d
'/'
-f1
)
local
IPADDR
=
$(
ip
-4
addr show dev
${
i
[0]
}
|
awk
'/inet/ {print $2}'
|
cut
-d
'/'
-f1
)
[[
-n
$IPADDR
&&
$IPADDR
!=
"172.24.1.1"
]]
&&
LIST+
=(
"
${
i
[0]//[[
:blank:]]/
}
"
"
${
IPADDR
}
"
)
[[
$IPADDR
!=
"172.24.1.1"
]]
&&
LIST+
=(
"
${
i
[0]//[[
:blank:]]/
}
"
"
${
IPADDR
}
"
)
done
done
LIST_LENGHT
=
$((${#
LIST
[@]
}
/
2
))
;
LIST_LENGHT
=
$((${#
LIST
[@]
}
/
2
))
;
if
[
"
$LIST_LENGHT
"
-eq
0
]
;
then
if
[
"
$LIST_LENGHT
"
-eq
0
]
;
then
...
@@ -620,4 +620,4 @@ function connect_bt_interface ()
...
@@ -620,4 +620,4 @@ function connect_bt_interface ()
fi
fi
fi
fi
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment