Skip to content

Commit

Permalink
ns-api: fix module loader
Browse files Browse the repository at this point in the history
  • Loading branch information
filippocarletti authored and gsanchietti committed May 21, 2024
1 parent 7785bfc commit 0073701
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/ns-api/files/load-kernel-modules
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
exit_code=0

# Load all module
for line in "$(grep -v '^#' /etc/modules.d/ns-nathelpers)"; do
module=$(echo $line | awk '{print $1}')
grep -v '^#' /etc/modules.d/ns-nathelpers | while IFS= read -r line ; do
module=$(echo "$line" | awk '{print $1}')
modprobe $module
for param in $(echo $line | awk '{for(i=2;i<=NF;++i)print $i}'); do
# Set parameter using /sys since modprobe doesn't support parameters
Expand All @@ -27,4 +27,4 @@ for line in "$(grep -v '^#' /etc/modules.d/ns-nathelpers)"; do
done

# Special exit code 99 means that at least one parameter failed to be set
exit $exit_code
exit $exit_code

0 comments on commit 0073701

Please sign in to comment.