mirror of
https://github.com/Fishwaldo/build.git
synced 2025-06-28 09:08:39 +00:00
[small RFC / cleanup] Tweaking script https://github.com/armbian/build/issues/1140 and removing deprecated config file rk3399-dev
This commit is contained in:
parent
f18360d1ef
commit
b60934a9d0
2 changed files with 5 additions and 5993 deletions
File diff suppressed because it is too large
Load diff
|
@ -35,10 +35,11 @@ MACADDR=$(printf ${prefixes[$random]}':%02X:%02X:%02X:%02X:%02X\n' $[RANDOM%256]
|
|||
set_fixed_mac ()
|
||||
{
|
||||
|
||||
local nmcli_query=$(nmcli -f UUID,DEVICE,TYPE connection show --active | grep ethernet | head -1)
|
||||
device=$(echo $nmcli_query | awk '{print $2}' )
|
||||
uuid=$(echo $nmcli_query | awk '{print $1}' )
|
||||
MACADDR=$(nmcli device show $device | grep -i hwaddr | awk '{print $2}')
|
||||
CONNECTION="$(nmcli -f UUID,ACTIVE,DEVICE,TYPE connection show --active | tail -n1)"
|
||||
UUID=$(awk -F" " '/ethernet/ {print $1}' <<< "${CONNECTION}")
|
||||
DEVNAME=$(awk -F" " '/ethernet/ {print $3}' <<< "${CONNECTION}")
|
||||
MACADDR=$(/sbin/ip link | grep -A1 ${DEVNAME} | awk -F" " '/ether / {print $2}')
|
||||
|
||||
[[ -z $MACADDR ]] && get_random_mac
|
||||
|
||||
if [[ -n $uuid ]]; then
|
||||
|
@ -49,4 +50,3 @@ if [[ -n $uuid ]]; then
|
|||
return 0
|
||||
fi
|
||||
} # set fixed mac to the 1st active network adapter
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue