Last active
May 31, 2021 03:23
-
-
Save ihipop/3392072466b71352000331a033eea184 to your computer and use it in GitHub Desktop.
N1 CoreELEC mac address fix
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
UsAge: https://blog.ihipop.info/?p=5315