mirror of
https://github.com/troglobit/finit.git
synced 2026-11-16 19:20:26 +00:00
networking(): check first ifup exists
Check first ifup exists before using it since this is really something only exits on some distros an in different ways. Debian/Ubunu has an package for this while others have it in the initscripts package(s) , meaning the file can be around even without the prog. Signed-off-by: crazy <crazy@frugalware.org>
This commit is contained in:
1 parent
a44daf20cb
commit
885056a6c9
1 file changed
+4
-1
+4
-1
@@ -155,7 +155,9 @@ static void networking(void)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Debian/Ubuntu/Busybox interfaces file */
|
/* Debian/Ubuntu/Busybox/RH/Suse */
|
||||||
|
if (fexist("/sbin/ifup")) {
|
||||||
|
/* interfaces file */
|
||||||
fp = fopen("/etc/network/interfaces", "r");
|
fp = fopen("/etc/network/interfaces", "r");
|
||||||
if (fp) {
|
if (fp) {
|
||||||
int i = 0;
|
int i = 0;
|
||||||
@@ -186,6 +188,7 @@ static void networking(void)
|
|||||||
if (i)
|
if (i)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Fall back to bring up at least loopback */
|
/* Fall back to bring up at least loopback */
|
||||||
ifconfig("lo", "127.0.0.1", "255.0.0.0", 1);
|
ifconfig("lo", "127.0.0.1", "255.0.0.0", 1);
|
||||||
|
|||||||
Reference in new issue
Block a user