include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/download.mk

PKG_NAME:=ospf6d-frr
PKG_VERSION:=2026-07-07
PKG_RELEASE:=1
PKG_LICENSE:=Teltonika-closed

include $(INCLUDE_DIR)/package.mk

define Package/ospf6d-frr
	SECTION:=net
	CATEGORY:=Network
	TITLE:=Configuration template for frr-ospf6d service
	DEPENDS:=+frr-ospf6d
	USERID:=ospf6:frr
endef

define Package/ospf6d-frr/description
	Configuration template for frr-ospf6d service
endef



define Package/ospf6d-frr/install
	$(INSTALL_DIR) $(1)/etc/init.d/
	$(INSTALL_BIN_USR) files/etc/init/ospf6.init $(1)/etc/init.d/ospf6
endef

define Package/ospf6d-frr/postinst
	#!/bin/sh
	. /lib/functions.sh

	get_status() {

		config_load "ospf6"
		config_get enabled "ospf6" "enabled" "0"

		[ "$$enabled" == "0" ] && return 1

		return 0
	}

	get_status && /etc/init.d/frr reload

	exit 0
endef

define Package/ospf6d-frr/prerm
	#!/bin/sh
	. /lib/functions.sh

	get_status() {

		config_load "ospf6"
		config_get enabled "ospf6" "enabled" "0"

		[ "$$enabled" == "0" ] && return 1

		return 0
	}

	get_status && /etc/init.d/frr reload

	exit 0
endef

$(eval $(call BuildPackage,ospf6d-frr))
