mirror of
https://github.com/kiddin9/op-packages.git
synced 2026-10-26 22:12:51 +08:00
30 lines
737 B
Bash
30 lines
737 B
Bash
#!/bin/sh /etc/rc.common
|
|
# procd init for meow's ARP client-steering loop (arp-hijack.sh). Self-gates on
|
|
# the `arp_hijack` section of /etc/config/meow: does nothing unless enabled and
|
|
# at least the feature is turned on. Separate from the meow service so steering
|
|
# can be toggled without restarting the proxy.
|
|
|
|
USE_PROCD=1
|
|
START=96
|
|
STOP=9
|
|
|
|
PROG=/usr/share/meow/arp-hijack.sh
|
|
|
|
start_service() {
|
|
local enabled
|
|
config_load meow
|
|
config_get_bool enabled arp enabled 0
|
|
[ "$enabled" -eq 1 ] || return 0
|
|
|
|
procd_open_instance meow-arp
|
|
procd_set_param command "$PROG" run
|
|
procd_set_param respawn 3600 5 5
|
|
procd_set_param stdout 1
|
|
procd_set_param stderr 1
|
|
procd_close_instance
|
|
}
|
|
|
|
service_triggers() {
|
|
procd_add_reload_trigger "meow"
|
|
}
|