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
a75f51da
Commit
a75f51da
authored
Mar 23, 2018
by
Igor Pecovnik
Browse files
More adjustement for Network manager
parent
ddfa0f85
Changes
2
Show whitespace changes
Inline
Side-by-side
debian-config-jobs
View file @
a75f51da
...
...
@@ -200,7 +200,9 @@ function jobs ()
fi
else
if
[[
-n
$(
LC_ALL
=
C nmcli device status |
grep
$DEFAULT_ADAPTER
|
grep
connected
)
]]
;
then
nmcli connection delete uuid
$(
LC_ALL
=
C nmcli
-f
UUID,DEVICE connection show |
grep
$DEFAULT_ADAPTER
|
awk
'{print $1}'
)
nmcli connection delete uuid
$(
LC_ALL
=
C nmcli
-f
UUID,DEVICE connection show |
grep
$DEFAULT_ADAPTER
|
awk
'{print $1}'
)
>
/dev/null 2>&1
nmcli con add con-name
"Armbian ethernet"
type
ethernet ifname
$DEFAULT_ADAPTER
>
/dev/null 2>&1
nmcli con up
"Armbian ethernet"
>
/dev/null 2>&1
else
create_if_config
"
$DEFAULT_ADAPTER
"
"
$DEFAULT_ADAPTER
"
"dynamic"
>
/etc/network/interfaces
fi
...
...
debian-config-submenu
View file @
a75f51da
...
...
@@ -260,15 +260,14 @@ exec 3>&1
read
-r
address
;
read
-r
netmask
;
read
-r
gateway
if
[[
$?
=
0
]]
;
then
localuuid
=
$(
LC_ALL
=
C nmcli
-f
UUID,DEVICE connection show |
grep
$1
|
awk
'{print $1}'
)
nmcli con mod
$localuuid
ipv4.method manual ipv4.addresses
"
$address
/
$netmask
"
nmcli con mod
$localuuid
ipv4.method manual ipv4.gateway
"
$gateway
"
nmcli con mod
$localuuid
ipv4.dns
"8.8.8.8,
$gateway
"
nmcli c down
$localuuid
nmcli con mod
$localuuid
ipv4.method manual ipv4.addresses
"
$address
/
$netmask
"
>
/dev/null 2>&1
nmcli con mod
$localuuid
ipv4.method manual ipv4.gateway
"
$gateway
"
>
/dev/null 2>&1
nmcli con mod
$localuuid
ipv4.dns
"8.8.8.8,
$gateway
"
>
/dev/null 2>&1
nmcli c
on
down
$localuuid
>
/dev/null 2>&1
sleep
2
nmcli c up
$localuuid
nmcli c
on
up
$localuuid
>
/dev/null 2>&1
fi
}
exit
}
...
...
@@ -639,7 +638,7 @@ function select_default_interface ()
for
i
in
"
${
ADAPTER
[@]
}
"
do
local
IPADDR
=
$(
ip
-4
addr show dev
${
i
[0]
}
|
awk
'/inet/ {print $2}'
|
cut
-d
'/'
-f1
)
LIST+
=(
"
${
i
[0]//[[
:blank:]]/
}
"
"
${
IPADDR
}
"
)
[[
-n
$IPADDR
&&
$IPADDR
!=
"172.24.1.1"
]]
&&
LIST+
=(
"
${
i
[0]//[[
:blank:]]/
}
"
"
${
IPADDR
}
"
)
done
LIST_LENGHT
=
$((${#
LIST
[@]
}
/
2
))
;
if
[
"
$LIST_LENGHT
"
-eq
0
]
;
then
...
...
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