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
4e6ca7f8
Unverified
Commit
4e6ca7f8
authored
Sep 27, 2018
by
Igor Pečovnik
Committed by
GitHub
Sep 27, 2018
Browse files
bugfix
more resilient way of detection IP
parent
0ab5f3eb
Changes
1
Hide whitespace changes
Inline
Side-by-side
debian-software
View file @
4e6ca7f8
...
...
@@ -1449,7 +1449,8 @@ TTY_X=$(($(stty size | awk '{print $2}')-6)) # determine terminal width
TTY_Y=$(($(stty size | awk '{print $1}')-6)) # determine terminal height
distribution=$(lsb_release -cs)
family=$(lsb_release -is)
serverIP=$(ip route get 8.8.8.8 | awk '{ print $NF; exit }')
DEFAULT_ADAPTER=$(ip -4 route ls | grep default | grep -Po '(?
<
=
dev
)(\
S
+)')
serverIP=
$(ip
-4
addr
show
dev
$
DEFAULT_ADAPTER
|
awk
'/
inet
/
{
print
$2}'
|
cut
-d
'/'
-f1
)
set
${
serverIP
//./
}
SUBNET=
"$1.$2.$3."
hostnamefqdn=
$(hostname
-f
)
...
...
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