#
# Copyright 2018 devolo AG
#

delos_wps_clone_post() {
	local action=$1; shift # enable/disable

	case "$action" in
	disable)
		# Clear the wps_clone state when wifi is stopped.
		uci_revert_state wireless wps_clone "" wps_clone
		;;
	esac
}

# is DELOS_WIFI_DRIVERS defined at all (empty or non-empty)? (force exit code 0 if empty,
# don't exit current script if not defined)
if (: ${DELOS_WIFI_DRIVERS?}) 2>/dev/null; then
	# we were sourced to register as a plugin
	delos_wps_clone() {
		type=$1; shift
		type delos_wps_clone_$type >/dev/null 2>/dev/null && delos_wps_clone_$type "$@"
	}

	append DELOS_WIFI_DRIVERS delos_wps_clone
fi