Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link
Owner Author

@ihipop ihipop commented May 24, 2021

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