Skip to content

Commit

Permalink
ns-migration: load all NAT helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
gsanchietti committed May 21, 2024
1 parent d93dfa5 commit 621e61c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/ns-migration/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ define Package/ns-migration/install
$(INSTALL_BIN) ./files/scripts/openvpn_tunnels $(1)/usr/share/ns-migration/40openvpn_tunnels
$(INSTALL_BIN) ./files/scripts/ipsec $(1)/usr/share/ns-migration/40ipsec
$(INSTALL_BIN) ./files/scripts/hotspot $(1)/usr/share/ns-migration/40hotspot
$(INSTALL_BIN) ./files/scripts/nat_helpers $(1)/usr/share/ns-migration/40nat_helpers
$(INSTALL_BIN) ./files/scripts/rules $(1)/usr/share/ns-migration/50rules
$(INSTALL_BIN) ./files/scripts/redirects $(1)/usr/share/ns-migration/50redirects
$(INSTALL_BIN) ./files/scripts/reverse_proxy $(1)/usr/share/ns-migration/60reverse_proxy
Expand Down
24 changes: 24 additions & 0 deletions packages/ns-migration/files/scripts/nat_helpers
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/sh

#
# Copyright (C) 2024 Nethesis S.r.l.
# SPDX-License-Identifier: GPL-2.0-only
#


> /etc/modules.d/ns-nathelpers

# Configure FTP helpers
for m in $(opkg files kmod-nf-nathelper | grep -e '\.ko$' | cut -d'/' -f 5 | cut -d'.' -f1); do
echo $m >> /etc/modules.d/ns-nathelpers
done

# Configure all extra helpers
for m in $(opkg files kmod-nf-nathelper-extra | grep -e '\.ko$' | cut -d'/' -f 5 | cut -d'.' -f1); do
echo $m >> /etc/modules.d/ns-nathelpers
done

# Load all helpers
for m in $(cat /etc/modules.d/ns-nathelpers); do
modprobe $m
done

0 comments on commit 621e61c

Please sign in to comment.