#!/bin/sh

. /lib/functions.sh

device="$(uci_get_state delos baptization DlanMacAddress)"
[ -n "$device" ] || exit 1
nmk=$(plctool -i "$1" -I "$device" | grep NMK | cut -d' ' -f 2)
[ -n "$nmk" ] || exit 1
plctool -i "$1" -D "$(hpavkey -D "$2")" -J FF:FF:FF:FF:FF:FF -K "$nmk" "$device"
