1
0
mirror of https://git.openwrt.org/feed/packages.git synced 2024-06-26 09:37:44 +02:00
openwrt-packages/net/bcp38/files/bcp38.init
Jo-Philipp Wich a6ea246cb2 bcp38: add init script
This commit adds a simple procd init script for bcp38 with the sole purpose
to register a configuration change trigger for /etc/config/bcp38.

The change will allow for automatic firewall reloads triggered by invoking
/sbin/reload_config or through ubus config change events emitted by LuCI.

With the init script in place and started, calling

  ubus call service event '{"type":"config.change","data":{"package":"bcp38"}}'

or

  /sbin/reload_config

will issue an /etc/init.d/firewall reload if /etc/config/bcp38 has been
modified since the last reload_config call.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2018-04-19 11:02:10 +02:00

12 lines
161 B
Bash
Executable File

#!/bin/sh /etc/rc.common
START=20
USE_PROCD=1
NAME=bcp38
service_triggers()
{
procd_add_config_trigger "config.change" "bcp38" /etc/init.d/firewall reload
}