Skip to content

Instantly share code, notes, and snippets.

@ihipop
Last active May 31, 2021 03:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ihipop/3392072466b71352000331a033eea184 to your computer and use it in GitHub Desktop.
Save ihipop/3392072466b71352000331a033eea184 to your computer and use it in GitHub Desktop.
N1 CoreELEC mac address fix
[Unit]
Description=MAC address loader for %I From bootloader env
ConditionFileIsExecutable=/usr/sbin/fw_printenv
Wants=network-pre.target
Before=network-pre.target
BindsTo=sys-subsystem-net-devices-%i.device
After=sys-subsystem-net-devices-%i.device
[Service]
Type=oneshot
ExecStartPre=/bin/bash -c '[ -z $(/usr/sbin/fw_printenv mac_%i -n 2>/dev/null) ] && { echo "Error: No Mac Address detect for %i from bootloader env";exit 1; } || exit 0'
ExecStart=/bin/bash -c 'MAC_%i=$(/usr/sbin/fw_printenv mac_%i -n 2>/dev/null);/sbin/ip link set dev %i address $MAC_%i'
#ExecStart=/sbin/ip link set dev %i up
[Install]
WantedBy=multi-user.target
@ihipop
Copy link
Author

ihipop commented May 24, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment