diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2017-12-25 22:38:17 +0100 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2017-12-25 22:38:17 +0100 |
commit | c2a378ea568aadd61a8a624ea86b95cc01b875d8 (patch) | |
tree | c619e603c9ef81ba764a66d51574632b4cfc801e /contrib | |
parent | 7f3f14fb0a0688cabb589bb779164c0b658666f3 (diff) |
freetz firmware pkg
Diffstat (limited to 'contrib')
8 files changed, 135 insertions, 0 deletions
diff --git a/contrib/freetz/make/pingtunnel-ng/Config.in b/contrib/freetz/make/pingtunnel-ng/Config.in new file mode 100644 index 0000000..c4e7655 --- /dev/null +++ b/contrib/freetz/make/pingtunnel-ng/Config.in @@ -0,0 +1,9 @@ +config FREETZ_PACKAGE_PINGTUNNEL_NG + bool "Pingtunnel-NG 1.1" + default n + help + Ptunnel-NG is an application that allows you to reliably tunnel TCP + connections to a remote host using ICMP echo request and reply packets, + commonly known as ping requests and replies. At first glance, this might + seem like a rather useless thing to do, but it can actually come in + handy in some cases. This is the [N]ew [G]eneration fork of PingTunnel! diff --git a/contrib/freetz/make/pingtunnel-ng/external.files b/contrib/freetz/make/pingtunnel-ng/external.files new file mode 100644 index 0000000..0491f65 --- /dev/null +++ b/contrib/freetz/make/pingtunnel-ng/external.files @@ -0,0 +1 @@ +[ "$EXTERNAL_FREETZ_PACKAGE_PINGTUNNEL_NG" == "y" ] && EXTERNAL_FILES+=" /usr/sbin/ptunnel-ng" diff --git a/contrib/freetz/make/pingtunnel-ng/external.in b/contrib/freetz/make/pingtunnel-ng/external.in new file mode 100644 index 0000000..033f18a --- /dev/null +++ b/contrib/freetz/make/pingtunnel-ng/external.in @@ -0,0 +1,7 @@ +config EXTERNAL_FREETZ_PACKAGE_PINGTUNNEL_NG + depends on EXTERNAL_ENABLED && FREETZ_PACKAGE_PINGTUNNEL_NG + bool "pingtunnel-ng" + default n + help + externals the following file(s): + /usr/sbin/ptunnel-ng diff --git a/contrib/freetz/make/pingtunnel-ng/external.services b/contrib/freetz/make/pingtunnel-ng/external.services new file mode 100644 index 0000000..73ea3a2 --- /dev/null +++ b/contrib/freetz/make/pingtunnel-ng/external.services @@ -0,0 +1,2 @@ +[ "$EXTERNAL_FREETZ_PACKAGE_PINGTUNNEL_NG" == "y" ] && EXTERNAL_SERVICES+=" pingtunnel-ng" + diff --git a/contrib/freetz/make/pingtunnel-ng/files/root/etc/default.pingtunnel-ng/pingtunnel-ng.cfg b/contrib/freetz/make/pingtunnel-ng/files/root/etc/default.pingtunnel-ng/pingtunnel-ng.cfg new file mode 100644 index 0000000..a70e8e6 --- /dev/null +++ b/contrib/freetz/make/pingtunnel-ng/files/root/etc/default.pingtunnel-ng/pingtunnel-ng.cfg @@ -0,0 +1,4 @@ +export PINGTUNNELNG_ENABLED='no' +export PINGTUNNELNG_PASSWORD='' +export PINGTUNNELNG_EXTRA='' +export PINGTUNNELNG_MAGIC='0xdeadc0de' diff --git a/contrib/freetz/make/pingtunnel-ng/files/root/etc/init.d/rc.pingtunnel-ng b/contrib/freetz/make/pingtunnel-ng/files/root/etc/init.d/rc.pingtunnel-ng new file mode 100755 index 0000000..cc60526 --- /dev/null +++ b/contrib/freetz/make/pingtunnel-ng/files/root/etc/init.d/rc.pingtunnel-ng @@ -0,0 +1,57 @@ +#!/bin/sh + +DAEMON=pingtunnel-ng +DAEMON_BIN=ptunnel-ng +PID_FILE=/var/run/$DAEMON.pid +. /etc/init.d/modlibrc + +start() { + mkdir -p /tmp/$DAEMON_BIN + [ -z "$PINGTUNNELNG_EXTRA" ] && PINGTUNNELNG_EXTRA="--syslog" + modlib_startdaemon $DAEMON_BIN \ + $PINGTUNNELNG_EXTRA \ + --magic $PINGTUNNELNG_MAGIC \ + --passwd $PINGTUNNELNG_PASSWORD \ + --daemon $PID_FILE \ + --chroot /tmp/$DAEMON_BIN \ + --user nobody \ + --group nobody +} + +stop_post() { + [ "$1" == "0" ] && rm -rf /tmp/$DAEMON_BIN 2>/dev/null +} + +case $1 in + ""|load) + modlib_add_user_and_group nobody + + modreg cgi 'pingtunnel-ng' 'pingtunnel-ng' + modreg daemon $DAEMON + + modlib_start $PINGTUNNELNG_ENABLED + ;; + unload) + modunreg daemon $DAEMON + modunreg cgi 'pingtunnel-ng' + modlib_stop + ;; + start) + modlib_start + ;; + stop) + modlib_stop + ;; + restart) + modlib_restart + ;; + status) + modlib_status + ;; + *) + echo "Usage: $0 [load|unload|start|stop|restart|status]" 1>&2 + exit 1 + ;; +esac + +exit 0 diff --git a/contrib/freetz/make/pingtunnel-ng/files/root/usr/lib/cgi-bin/pingtunnel-ng.cgi b/contrib/freetz/make/pingtunnel-ng/files/root/usr/lib/cgi-bin/pingtunnel-ng.cgi new file mode 100755 index 0000000..ae6b9e4 --- /dev/null +++ b/contrib/freetz/make/pingtunnel-ng/files/root/usr/lib/cgi-bin/pingtunnel-ng.cgi @@ -0,0 +1,20 @@ +#!/bin/sh + +. /usr/lib/libmodcgi.sh + +sec_begin '$(lang de:"Starttyp" en:"Start type")' +cgi_print_radiogroup_service_starttype "enabled" "$PINGTUNNELNG_ENABLED" "" "" 0 +sec_end + +sec_begin '$(lang de:"Server" en:"Server")' + +cgi_print_password_p "password" "$PINGTUNNELNG_PASSWORD" 20/32 \ + "$(lang de:"Tunnel-Passwort" en:"Tunnel password"): " + +cgi_print_textline_p "extra" "$PINGTUNNELNG_EXTRA" 40/255 \ + "$(lang de:"Erweiterte Optionen" en:"Extra options"): " + +cgi_print_textline_p "magic" "$PINGTUNNELNG_MAGIC" 20/32 \ + "$(lang de:"ICMP Tunnel magische Nummer" en:"ICMP Tunnel Magic Number"): " + +sec_end diff --git a/contrib/freetz/make/pingtunnel-ng/pingtunnel-ng.mk b/contrib/freetz/make/pingtunnel-ng/pingtunnel-ng.mk new file mode 100644 index 0000000..20c2a8d --- /dev/null +++ b/contrib/freetz/make/pingtunnel-ng/pingtunnel-ng.mk @@ -0,0 +1,35 @@ +$(call PKG_INIT_BIN, 1.1) +$(PKG)_SOURCE:=ptunnel-ng-$($(PKG)_VERSION).tar.gz +$(PKG)_SOURCE_SHA256:=3182ecc4f9a7ef3ae8895b460aa596ae050b9718b98fd5eaf224772fba017c22 +$(PKG)_SITE:=https://github.com/lnslbrty/ptunnel-ng/releases/download/v$($(PKG)_VERSION) +$(PKG)_DIR:=$($(PKG)_SOURCE_DIR)/ptunnel-ng-$($(PKG)_VERSION) + +$(PKG)_BINARY:=$($(PKG)_DIR)/src/ptunnel-ng +$(PKG)_TARGET_BINARY:=$($(PKG)_DEST_DIR)/usr/sbin/ptunnel-ng + +$(PKG)_BUILD_PREREQ += aclocal automake autoconf +$(PKG)_DEPENDS_ON += libpcap + +$(PKG)_EXTRA_CFLAGS += -std=gnu99 +$(PKG)_CONFIGURE_OPTIONS += --disable-selinux + +$(PKG_SOURCE_DOWNLOAD) +$(PKG_UNPACKED) +$(PKG_CONFIGURED_CONFIGURE) + +$($(PKG)_BINARY): $($(PKG)_DIR)/.configured + echo "______$(PINGTUNNEL_NG_EXTRA_CFLAGS)_____" + $(SUBMAKE) -C $(PINGTUNNEL_NG_DIR) V=1 \ + CFLAGS="$(TARGET_CFLAGS) $(PINGTUNNEL_NG_EXTRA_CFLAGS)" + +$($(PKG)_TARGET_BINARY): $($(PKG)_BINARY) + $(INSTALL_BINARY_STRIP) + +$(pkg): + +$(pkg)-precompiled: $($(PKG)_TARGET_BINARY) + +$(pkg)-uninstall: + $(RM) $(PINGTUNNEL_NG_TARGET_BINARY) + +$(PKG_FINISH) |