git: 043c3a009e2a - main - net/wireproxy: Add rc script
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 20 Feb 2026 08:16:42 UTC
The branch main has been updated by lwhsu:
URL: https://cgit.FreeBSD.org/ports/commit/?id=043c3a009e2ad036edd4d6c287f8ee43688e8983
commit 043c3a009e2ad036edd4d6c287f8ee43688e8983
Author: Manuel Wiesinger <mdw@freebsd.org>
AuthorDate: 2026-02-20 08:16:08 +0000
Commit: Li-Wen Hsu <lwhsu@FreeBSD.org>
CommitDate: 2026-02-20 08:16:08 +0000
net/wireproxy: Add rc script
PR: 286990
---
net/wireproxy/Makefile | 4 ++-
net/wireproxy/files/wireproxy.in | 64 ++++++++++++++++++++++++++++++++++++++++
2 files changed, 67 insertions(+), 1 deletion(-)
diff --git a/net/wireproxy/Makefile b/net/wireproxy/Makefile
index 1706f944e07d..8e14d5f212a5 100644
--- a/net/wireproxy/Makefile
+++ b/net/wireproxy/Makefile
@@ -1,7 +1,7 @@
PORTNAME= wireproxy
DISTVERSIONPREFIX= v
DISTVERSION= 1.0.9
-PORTREVISION= 18
+PORTREVISION= 19
CATEGORIES= net
MAINTAINER= lwhsu@FreeBSD.org
@@ -16,6 +16,8 @@ USES= go:modules
GO_MODULE= github.com/pufferffish/wireproxy
GO_TARGET= ./cmd/wireproxy
+USE_RC_SUBR= wireproxy
+
PLIST_FILES= bin/wireproxy
.include <bsd.port.mk>
diff --git a/net/wireproxy/files/wireproxy.in b/net/wireproxy/files/wireproxy.in
new file mode 100644
index 000000000000..019337445fd5
--- /dev/null
+++ b/net/wireproxy/files/wireproxy.in
@@ -0,0 +1,64 @@
+#!/bin/sh
+
+# PROVIDE: wireproxy
+# REQUIRE: LOGIN NETWORKING
+# KEYWORD: shutdown
+
+# Add the following lines to /etc/rc.conf to enable wireproxy:
+# wireproxy_enable (bool): Set to "NO" by default.
+# Set it to "YES" to enable wireproxy.
+# wireproxy_checkconfig (bool): Set to "YES" by default.
+# Set it to "YES" to check configuration when starting.
+# wireproxy_configfile (str): Set to "%%PREFIX%%/etc/wireproxy.conf" by default.
+# Path to configuration file.
+# wireproxy_logfile (str): Set to "/var/log/wireproxy.log" by default.
+# Path to log file.
+# wireproxy_user (str): Set to "nobody" by default.
+# User to run wireproxy.
+# wireproxy_flags (str): Set to "" by default.
+# Extra flags passed to start command.
+
+. /etc/rc.subr
+
+name=wireproxy
+rcvar=wireproxy_enable
+desc="WireGuard client that exposes itself as a SOCKS5/HTTP proxy"
+
+load_rc_config ${name}
+
+: ${wireproxy_enable:=NO}
+: ${wireproxy_checkconfig=YES}
+: ${wireproxy_configfile="%%PREFIX%%/etc/wireproxy.conf"}
+: ${wireproxy_logfile=/var/log/wireproxy.log}
+: ${wireproxy_user=nobody}
+
+procname="%%PREFIX%%/bin/wireproxy"
+pidfile="/var/run/${name}.pid"
+daemonpidfile="/var/run/daemon_${name}.pid"
+required_files="${wireproxy_configfile}"
+command=/usr/sbin/daemon
+command_args="-f -H -o ${wireproxy_logfile} -p ${pidfile} -P ${daemonpidfile} ${procname} -c ${wireproxy_configfile}"
+
+start_precmd="${name}_precmd"
+stop_postcmd="rm -f ${pidfile} ${daemonpidfile}"
+configtest_cmd="${name}_configtest"
+extra_commands=configtest
+
+wireproxy_precmd()
+{
+ /usr/bin/install -m 600 -o ${wireproxy_user} /dev/null ${pidfile}
+ /usr/bin/install -m 600 -o ${wireproxy_user} /dev/null ${daemonpidfile}
+ /usr/bin/install -m 640 -o ${wireproxy_user} /dev/null ${wireproxy_logfile}
+
+ if checkyesno wireproxy_checkconfig; then
+ wireproxy_configtest
+ fi
+}
+
+wireproxy_configtest()
+{
+ echo "Performing sanity check on ${name} configuration:"
+ ${procname} --configtest --config ${wireproxy_configfile}
+}
+
+run_rc_command "$1"