plugins: modules-load: skip lines starting with '#'

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2022-04-27 07:46:03 +02:00
parent 605c489937
commit 10392e9639
2 changed files with 7 additions and 1 deletions
+4 -1
View File
@@ -40,7 +40,10 @@ For your convenience a set of *optional* plugins are available:
* *rtc.so*: Restore and save system clock from/to RTC on boot/halt. * *rtc.so*: Restore and save system clock from/to RTC on boot/halt.
Enabled by default. Enabled by default.
* *modules-load.so*: Scans /etc/modules-load.d for modules to modprobe. * *modules-load.so*: Scans `/etc/modules-load.d/` for modules to load
using `modprobe`. Each file in this directory can contain multiple
lines with the name of the module to load. Any line starting with
the standard UNIX comment character, `#`, is skipped.
* *netlink.so*: Listens to Linux kernel Netlink events for gateway and * *netlink.so*: Listens to Linux kernel Netlink events for gateway and
interfaces. These events are then sent to the Finit service monitor interfaces. These events are then sent to the Finit service monitor
+3
View File
@@ -69,6 +69,9 @@ static void load(void *arg)
while (fgets(line, sizeof(line), fp)) { while (fgets(line, sizeof(line), fp)) {
char cmd[CMD_SIZE], *mod, *args; char cmd[CMD_SIZE], *mod, *args;
if (line[0] == '#')
continue;
mod = strip_line(line); mod = strip_line(line);
if (!*mod) if (!*mod)
continue; continue;