File tree Expand file tree Collapse file tree 5 files changed +48
-38
lines changed
Expand file tree Collapse file tree 5 files changed +48
-38
lines changed Original file line number Diff line number Diff line change @@ -37,15 +37,22 @@ endef
3737define Build/Compile
3838endef
3939
40+ define Package/ns-netmap/postinst
41+ # !/bin/sh
42+ if [ -z "$${IPKG_INSTROOT}" ]; then
43+ /etc/init.d/ns-netmap enable
44+ /etc/init.d/ns-netmap restart
45+ fi
46+ exit 0
47+ endef
48+
4049define Package/ns-netmap/install
4150 $(INSTALL_DIR ) $(1 ) /usr/sbin
4251 $(INSTALL_DIR ) $(1 ) /etc/config
43- $(INSTALL_DIR ) $(1 ) /usr/libexec/ns-api/pre-commit
44- $(INSTALL_DIR ) $(1 ) /usr/libexec/ns-api/post-commit
4552 $(INSTALL_BIN ) ./files/ns-netmap $(1 ) /usr/sbin/ns-netmap
4653 $(INSTALL_CONF ) ./files/config $(1 ) /etc/config/netmap
47- $(INSTALL_BIN ) ./files/generate-netmap.py $(1 ) /usr/libexec/ns-api/pre-commit/
48- $(INSTALL_BIN ) ./files/reload -netmap.py $(1 ) /usr/libexec /ns-api/post-commit/
54+ $(INSTALL_DIR ) $(1 ) /etc/init.d
55+ $(INSTALL_BIN ) ./files/ns -netmap.init $(1 ) /etc/init.d /ns-netmap
4956endef
5057
5158$(eval $(call BuildPackage,ns-netmap))
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1212#
1313
1414import os
15+ import subprocess
16+ import sys
1517import ipaddress
1618from euci import EUci
1719from nethsec import utils
@@ -79,9 +81,13 @@ def generate_rules():
7981 df .close ()
8082
8183def main ():
82- setup ()
83- cleanup ()
84- generate_rules ()
84+ if len (sys .argv ) > 1 and sys .argv [1 ] == "cleanup" :
85+ cleanup ()
86+ else :
87+ setup ()
88+ cleanup ()
89+ generate_rules ()
90+ subprocess .run (['/etc/init.d/firewall' , 'reload' ])
8591
8692if __name__ == "__main__" :
8793 main ()
Original file line number Diff line number Diff line change 1+ #! /bin/sh /etc/rc.common
2+
3+ #
4+ # Copyright (C) 2025 Nethesis S.r.l.
5+ # SPDX-License-Identifier: GPL-2.0-only
6+ #
7+
8+ START=99
9+ USE_PROCD=1
10+
11+ start_service () {
12+ # Main service
13+ procd_open_instance
14+ procd_set_param command /usr/sbin/ns-netmap
15+ procd_set_param stdout 1
16+ procd_set_param stderr 1
17+ procd_close_instance
18+ }
19+
20+ stop_service () {
21+ # Destroy nft table
22+ /usr/sbin/ns-netmap cleanup
23+ }
24+
25+ service_triggers ()
26+ {
27+ procd_add_reload_trigger netmap
28+ }
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments