From 194b764b07bb4a6aa228a89dec384c6b192070c0 Mon Sep 17 00:00:00 2001 From: Sergey Matveychuk Date: Tue, 23 Sep 2008 12:54:27 +0000 Subject: - Update to 2.0 --- net/dhcprelya/Makefile | 2 +- net/dhcprelya/distinfo | 6 +++--- net/dhcprelya/files/dhcprelya.in | 29 +++++++++++++++++++++-------- net/dhcprelya/pkg-descr | 16 +++------------- 4 files changed, 28 insertions(+), 25 deletions(-) diff --git a/net/dhcprelya/Makefile b/net/dhcprelya/Makefile index 2d8e5cbf496f..3dde04569c94 100644 --- a/net/dhcprelya/Makefile +++ b/net/dhcprelya/Makefile @@ -6,7 +6,7 @@ # PORTNAME= dhcprelya -PORTVERSION= 1.3 +PORTVERSION= 2.0 CATEGORIES= net MASTER_SITES= http://people.yandex-team.ru/~sem/ diff --git a/net/dhcprelya/distinfo b/net/dhcprelya/distinfo index 0c340f640aa1..429cb3a9867c 100644 --- a/net/dhcprelya/distinfo +++ b/net/dhcprelya/distinfo @@ -1,3 +1,3 @@ -MD5 (dhcprelya-1.3.tar.gz) = e6f0d9ced49041f51e1e4226049cdc40 -SHA256 (dhcprelya-1.3.tar.gz) = 527c1385eb50141351c186afe9d186dd18665361dcfded98c473578343e00faa -SIZE (dhcprelya-1.3.tar.gz) = 9275 +MD5 (dhcprelya-2.0.tar.gz) = bee5ecc651f24deec1a46db7ee065ee1 +SHA256 (dhcprelya-2.0.tar.gz) = ed8a4f0ebfad3e3165614e16e105fd5bb54849497b25e61a15c9425ec2d3c950 +SIZE (dhcprelya-2.0.tar.gz) = 10307 diff --git a/net/dhcprelya/files/dhcprelya.in b/net/dhcprelya/files/dhcprelya.in index b8283fe47088..73f00b91ddf5 100644 --- a/net/dhcprelya/files/dhcprelya.in +++ b/net/dhcprelya/files/dhcprelya.in @@ -6,28 +6,40 @@ # Add the following line to /etc/rc.conf to enable dhcrelay: # # dhcprelya_enable="YES" +# +# dhcprelya_config="/path/to/config.file" +# or # dhcprelya_servers="..." # dhcprelya_ifaces="..." # # override these variables in /etc/rc.conf dhcprelya_enable=${dhcprelya_enable:-"NO"} +dhcprelya_config=${dhcprelya_config:-} dhcprelya_servers=${dhcprelya_servers:-} # dhcprelya server(s) dhcprelya_ifaces=${dhcprelya_ifaces:-} # ethernet interface(s) dhcprelya_precmd () { - if [ -z "${dhcprelya_ifaces}" -o -z "${dhcprelya_servers}" ]; then - echo "Both dhcprelya_ifaces and dhcprelya_servers must be set in /etc/rc.conf" + if [ -z "${dhcprelya_config}" ]; then + if [ -z "${dhcprelya_ifaces}" -o -z "${dhcprelya_servers}" ]; then + echo "Either dhcprelya_config or both dhcprelya_ifaces and dhcprelya_servers must be set in /etc/rc.conf" exit 1 - fi + fi - ifaces= - for iface in ${dhcprelya_ifaces}; do + ifaces= + for iface in ${dhcprelya_ifaces}; do ifaces="${ifaces} -i ${iface}" - done + done + + rc_flags="${rc_flags} ${ifaces} ${dhcprelya_servers}" + else + rc_flags="${rc_flags} -f ${dhcprelya_config}" + fi +} - rc_flags="${rc_flags} ${ifaces} ${dhcprelya_servers}" +dhcprelya_postcmd() { + rm -f ${pidfile} } . %%RC_SUBR%% @@ -35,9 +47,10 @@ dhcprelya_precmd () name=dhcprelya rcvar=$(set_rcvar) pidfile=/var/run/${name}.pid -command=/usr/local/sbin/${name} +command=%%PREFIX%%/sbin/${name} start_precmd=${name}_precmd +stop_postcmd=${name}_postcmd load_rc_config ${name} run_rc_command "$1" diff --git a/net/dhcprelya/pkg-descr b/net/dhcprelya/pkg-descr index 023183a68bdc..55944de5f5ba 100644 --- a/net/dhcprelya/pkg-descr +++ b/net/dhcprelya/pkg-descr @@ -1,21 +1,11 @@ dhcprelya is a light DHCP relay agent written for Yandex company for high loaded routers with tens interfaces and thousands hosts behind them. -It's fast and does not depend on any side library. Some ideas was -taken from Edwin's dhcprelay (net/dhcprelay) which has some shortages. +It's fast, independed from any side libraries, and it does not turn on +a promisc mode for listen interfaces. It's distributed under BSD license. -How to run: - -dhcprelya [-d] [-p] -i... -i ... - --d - do not demonize and output debugging info onto terminal. --p - use not default pid file. You can run more than one copy of - dhcprelya. --i - an interfaces list these should be listened. -server - a servers list where request will be forward to. - -Any questions, bug reports and feature requests are welcome. +Read README file for instructions. Sergey Matveychuk -- cgit v1.2.3