#!/bin/sh
# shellcheck disable=SC2154

. /lib/functions.sh

dev=$1

olddevice=$(uci_get network fastd device "nonono")
if [ $olddevice != "$dev" ]; then
    logger -t fastd-up -p daemon.info "network interface name changed from $olddevice to $dev"
    uci_set network fastd device "$dev"
    uci_commit
    /etc/config/network reload
fi

ifup fastd