Skip to content

Commit

Permalink
sysutils/egress-monitor: Add new port
Browse files Browse the repository at this point in the history
Add sysutils/egress-monitor, a tool that is watching for default routes
changes and sets the interface group. When the default route is added,
egress-monitor sets the group of that interface to appropriate egress.

WWW: https://github.com/mekanix/egress-monitor

PR:		267731
Tested by:	dfr
  • Loading branch information
mekanix authored and jurajlutter committed Nov 15, 2022
1 parent 2f7bca0 commit 33e91db
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 0 deletions.
1 change: 1 addition & 0 deletions sysutils/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,7 @@
SUBDIR += eclat
SUBDIR += edid-decode
SUBDIR += edk2
SUBDIR += egress-monitor
SUBDIR += eject
SUBDIR += eksctl
SUBDIR += endian
Expand Down
22 changes: 22 additions & 0 deletions sysutils/egress-monitor/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
PORTNAME= egress-monitor
DISTVERSION= 0.0.3
CATEGORIES= sysutils

MAINTAINER= meka@tilda.center
COMMENT= Set network interface groups based on default routes
WWW= https://github.com/mekanix/egress-monitor

LICENSE= BSD2CLAUSE
LICENSE_FILE= ${WRKSRC}/LICENSE

USES= uidfix
USE_RC_SUBR= egress-monitor
SUB_FILES= pkg-message

USE_GITHUB= yes
GH_ACCOUNT= mekanix

PLIST_FILES= man/man1/egress-monitor.1.gz \
sbin/egress-monitor

.include <bsd.port.mk>
3 changes: 3 additions & 0 deletions sysutils/egress-monitor/distinfo
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
TIMESTAMP = 1668281396
SHA256 (mekanix-egress-monitor-0.0.3_GH0.tar.gz) = 74302e0fea9be384d791d7610c85a783696f71ab2ca005e98e590d14b12e1da5
SIZE (mekanix-egress-monitor-0.0.3_GH0.tar.gz) = 4937
22 changes: 22 additions & 0 deletions sysutils/egress-monitor/files/egress-monitor.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/sh

# PROVIDE: egress-monitor
# KEYWORD: shutdown
# REQUIRE: NETWORKING
# BEFORE: pf

. /etc/rc.subr

name=egress_monitor
desc="default route monitor"
rcvar=${name}_enable
load_rc_config $name

: ${egress_monitor_enable:="NO"}

procname="%%PREFIX%%/sbin/egress-monitor"
command="/usr/sbin/daemon"
command_args="-S -T ${name} ${procname}"

run_rc_command $*

8 changes: 8 additions & 0 deletions sysutils/egress-monitor/files/pkg-message.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[
{ type: install
message: <<EOM
Please note that egress-monitor will not pick up changes in net.fibs sysctl, so
if you change it, you have to "service egress-monitor restart".
EOM
}
]
4 changes: 4 additions & 0 deletions sysutils/egress-monitor/pkg-descr
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Watching for default routes changes and sets the interface group. When the
default route is added, egress-monitor sets the group of that interface to
appropriate egress. That means for IPv4 and FIB 0 (default one) the group will
be v4fib0egress. In general, the group name is v<4|6>fib<number>egress.

0 comments on commit 33e91db

Please sign in to comment.