# Save some useful initrams vars

# The boot interface name was stored in ltsp_config from the initramfs
test -n "$DEVICE" || return 0

# Also save the MAC address of the boot interface
LTSP_CLIENT_MAC=$(ip -oneline -family inet link show dev "$DEVICE" | sed -n '/.*ether[[:space:]]*\([[:xdigit:]:]*\).*/{s//\1/;y/abcdef-/ABCDEF:/;p}')
if [ -n "$LTSP_CLIENT_MAC" ]; then
    export LTSP_CLIENT_MAC
    echo "LTSP_CLIENT_MAC=$LTSP_CLIENT_MAC" >> /var/cache/ltsp/ltsp_config
fi
