mirror of
https://github.com/troglobit/finit.git
synced 2026-11-06 15:51:03 +00:00
Add support for ifupdown 'allow-hotplug' keyword
Look for 'auto' *and* 'allow-hotplug' in /etc/network/interfaces when bringing up Debian/BusyBox interfaces at boot. Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
bfe9e011bd
commit
82853bf0ea
1 file changed
+14
-7
@@ -107,16 +107,23 @@ static void networking(void)
|
|||||||
|
|
||||||
/* Bring up all 'auto' interfaces */
|
/* Bring up all 'auto' interfaces */
|
||||||
while (fgets(buf, sizeof(buf), fp)) {
|
while (fgets(buf, sizeof(buf), fp)) {
|
||||||
char *cmd;
|
char cmd[80];
|
||||||
|
char *line, *ifname = NULL;
|
||||||
|
|
||||||
chomp(buf);
|
chomp(buf);
|
||||||
cmd = strip_line(buf);
|
line = strip_line(buf);
|
||||||
|
|
||||||
if (!strncmp(cmd, "auto", 4)) {
|
if (!strncmp(line, "auto", 4))
|
||||||
memcpy(cmd, "ifup", 4);
|
ifname = &line[5];
|
||||||
run_interactive(cmd, "Bringing up interface %s", &cmd[5]);
|
if (!strncmp(line, "allow-hotplug", 13))
|
||||||
i++;
|
ifname = &line[14];
|
||||||
}
|
|
||||||
|
if (!ifname)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
snprintf(cmd, 80, "/sbin/ifup %s", ifname);
|
||||||
|
run_interactive(cmd, "Bringing up interface %s", ifname);
|
||||||
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
|
|||||||
Reference in new issue
Block a user