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