From 167bbdd2c3da7d9481cb31e5da45e507f826a3c6 Mon Sep 17 00:00:00 2001 From: actions-user Date: Sun, 16 Feb 2025 22:11:43 +0800 Subject: [PATCH] update 2025-02-16 22:11:43 --- ipv6-helper/Makefile | 56 +++++++++++++++++++ .../files/root/etc/hotplug.d/iface/60-6in4 | 12 ++++ 2 files changed, 68 insertions(+) create mode 100644 ipv6-helper/Makefile create mode 100755 ipv6-helper/files/root/etc/hotplug.d/iface/60-6in4 diff --git a/ipv6-helper/Makefile b/ipv6-helper/Makefile new file mode 100644 index 00000000..b905161a --- /dev/null +++ b/ipv6-helper/Makefile @@ -0,0 +1,56 @@ +# +# Copyright (C) 2015 OpenWrt-dist +# +# This is free software, licensed under the GNU General Public License v3. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=ipv6helper +PKG_VERSION:=1.0 +PKG_RELEASE:=2 + +PKG_LICENSE:=GPLv3 +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=LEAN + +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) + +include $(INCLUDE_DIR)/package.mk + +define Package/ipv6helper + SECTION:=ipv6 + TITLE:=IPv6 Helper and Dynamic Update he.net of ip + PKGARCH:=all + DEPENDS:=+luci-proto-ipv6 +wget +ip6tables +libip6tc +kmod-ipt-nat6 +odhcpd-ipv6only +odhcp6c +6in4 +endef + +define Package/ipv6helper/description + IPv6 Helper and Dynamic Update he.net of ip +endef + +define Build/Prepare +endef + +define Build/Configure +endef + +define Build/Compile +endef + +define Package/ipv6helper/postinst +#!/bin/sh +if [ -z "$${IPKG_INSTROOT}" ]; then + chmod 755 /etc/hotplug.d/iface/60-6in4 >/dev/null 2>&1 +fi +exit 0 +endef + +define Package/ipv6helper/install + $(INSTALL_DIR) $(1)/etc/hotplug.d/iface + $(INSTALL_BIN) ./files/root/etc/hotplug.d/iface/60-6in4 $(1)/etc/hotplug.d/iface/60-6in4 +endef + + +$(eval $(call BuildPackage,ipv6helper)) diff --git a/ipv6-helper/files/root/etc/hotplug.d/iface/60-6in4 b/ipv6-helper/files/root/etc/hotplug.d/iface/60-6in4 new file mode 100755 index 00000000..270aad1f --- /dev/null +++ b/ipv6-helper/files/root/etc/hotplug.d/iface/60-6in4 @@ -0,0 +1,12 @@ +#!/bin/sh +. /lib/functions.sh +if [ "$ACTION" != "ifup" ]; then + exit +fi +config_load network +config_get tunnelid $INTERFACE tunnelid +config_get username $INTERFACE username +config_get password $INTERFACE password +if [ "$tunnelid" != "" ]; then + wget -O - https://$username:$password@ipv4.tunnelbroker.net/nic/update?hostname=$tunnelid --no-check-certificate +fi