Add OpenRC service scripts for Mihomo and Mihomo IPtables

This commit is contained in:
2026-02-15 13:52:02 +03:00
parent d9233cc34e
commit 4064712533
4 changed files with 309 additions and 2 deletions

16
open-rc/mihomo Normal file
View File

@@ -0,0 +1,16 @@
#!/sbin/openrc-run
name="mihomo"
description="Mihomo Daemon"
command="/usr/local/bin/mihomo"
command_args="-d /etc/mihomo"
command_background=true
pidfile="/run/mihomo.pid"
# Запускаем от юзера, права на сеть дадим через setcap
command_user="mihomo:mihomo"
depend() {
need net
use dns
after firewall
}

14
open-rc/mihomo-iptables Normal file
View File

@@ -0,0 +1,14 @@
#!/sbin/openrc-run
description="Mihomo IPtables Rules"
depend() {
need net
before mihomo
}
start() {
ebegin "Applying Mihomo IPtables rules"
/usr/local/bin/iptables-mihomo-setup.sh
eend $?
}