add he-6in4 package to auto-update he 6in4 tunnel
This commit is contained in:
parent
301df3d431
commit
b182dd2f63
58
package/lean/he-6in4/Makefile
Normal file
58
package/lean/he-6in4/Makefile
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
#
|
||||||
|
# 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:=he-6in4
|
||||||
|
PKG_VERSION:=1.0
|
||||||
|
PKG_RELEASE:=1
|
||||||
|
|
||||||
|
PKG_LICENSE:=GPLv3
|
||||||
|
PKG_LICENSE_FILES:=LICENSE
|
||||||
|
PKG_MAINTAINER:=ghostry <ghostry@ghostry.cn>
|
||||||
|
|
||||||
|
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)
|
||||||
|
|
||||||
|
include $(INCLUDE_DIR)/package.mk
|
||||||
|
|
||||||
|
define Package/he-6in4
|
||||||
|
SECTION:=ipv6
|
||||||
|
CATEGORY:=Gmod
|
||||||
|
SUBMENU:=Network
|
||||||
|
TITLE:=Dynamic Update he.net of ip
|
||||||
|
PKGARCH:=all
|
||||||
|
DEPENDS:=+luci-proto-ipv6 +6in4 +curl
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/he-6in4/description
|
||||||
|
Dynamic Update he.net of ip
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Build/Prepare
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Build/Configure
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Build/Compile
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/he-6in4/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/he-6in4/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,he-6in4))
|
12
package/lean/he-6in4/files/root/etc/hotplug.d/iface/60-6in4
Normal file
12
package/lean/he-6in4/files/root/etc/hotplug.d/iface/60-6in4
Normal file
@ -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
|
||||||
|
curl -k -u "$username":"$password" https://ipv4.tunnelbroker.net/nic/update?hostname=$tunnelid
|
||||||
|
fi
|
Loading…
x
Reference in New Issue
Block a user