mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-11-01 16:44:23 +08:00
🌴 Sync 2026-03-05 23:51:42
This commit is contained in:
1 parent
97c049ed0a
commit
0acff03804
14253 files changed
+3893239
No files matched your search
@@ -0,0 +1,51 @@
|
||||
#
|
||||
# Copyright (C) 2016 Nikil Mehta <nikil.mehta@gmail.com>
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=totd
|
||||
PKG_VERSION:=1.5.3
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_MAINTAINER:=Konstantine Shevlakov <shevlakov@132lan.ru>
|
||||
PKG_LICENSE:=LICENSE
|
||||
PKG_LICENSE_FILES:=COPYING
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL:=https://github.com/fwdillema/totd.git
|
||||
PKG_SOURCE_VERSION:=b023efed28efc46236460a2c01488066ad890ae2
|
||||
|
||||
PKG_SOURCE_SUBDIR:=$(PKG_NAME)
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
|
||||
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
PKG_FIXUP:=autoreconf
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/$(PKG_NAME)
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=Trick or Treat Daemon (TOTD)
|
||||
URL:=https://github.com/fwdillema/totd
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/description
|
||||
Totd is a small DNS64 proxy nameserver that supports IPv6 only hosts/networks
|
||||
that communicate with the IPv4 world using some translation mechanism.
|
||||
endef
|
||||
|
||||
define Package/$(PKG_NAME)/install
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/usr/bin/
|
||||
$(CP) ./root/* $(1)/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,$(PKG_NAME)))
|
||||
@@ -0,0 +1,6 @@
|
||||
config totd
|
||||
option port '10053'
|
||||
list forwarder '8.8.8.8#53'
|
||||
list prefix '3ffe:abcd:1234:9876::'
|
||||
|
||||
|
||||
Executable
+67
@@ -0,0 +1,67 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=85
|
||||
STOP=30
|
||||
USE_PROCD=1
|
||||
PROG=/usr/bin/totd
|
||||
|
||||
validate_totd_section(){
|
||||
uci_validate_section totd totd "${1}" \
|
||||
'forwarder:list(string)' \
|
||||
'prefix:list(ipaddr)' \
|
||||
'port:uinteger' \
|
||||
'interface:list(string)' \
|
||||
'lookup:string' \
|
||||
'stf_enable:bool'
|
||||
}
|
||||
|
||||
totd(){
|
||||
config_load 'totd'
|
||||
local forwarder prefix port interface lookup stf_enable
|
||||
validate_totd_section "$1" || {
|
||||
logger -t "totd" "validation failed"
|
||||
return 1
|
||||
}
|
||||
|
||||
test -d /var/etc/ || mkdir -p /var/etc
|
||||
|
||||
{
|
||||
[ -n "$forwarder" ] && {
|
||||
for fa in $forwarder; do
|
||||
echo "$fa" | awk -F [#] '{print "forwarder "$1" port "$2}'
|
||||
done
|
||||
}
|
||||
[ -n "$prefix" ] && {
|
||||
for pr in $prefix; do
|
||||
echo "prefix $pr"
|
||||
done
|
||||
}
|
||||
[ -n "$port" ] && echo "port $port"
|
||||
[ -n "$interface" ] && echo "interfaces $interface"
|
||||
[ -n "$lookup" ] && echo "$lookup reverse lookup"
|
||||
[ -n "$stf_enable" -a "$stf_enable" = "1" ] && echo "stf"
|
||||
} > /var/etc/totd.conf
|
||||
procd_open_instance
|
||||
procd_append_param command $PROG -c /var/etc/totd.conf
|
||||
procd_set_param stdout 1
|
||||
procd_set_param stderr 1
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
start_service(){
|
||||
config_load 'totd'
|
||||
config_foreach totd "totd"
|
||||
}
|
||||
|
||||
stop_service(){
|
||||
kill `pgrep -f $PROG` > /dev/null 2>&1
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
restart
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger "totd"
|
||||
}
|
||||
Reference in new issue
Block a user