mirror of
https://github.com/troglobit/finit.git
synced 2026-11-21 19:51:46 +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;
|
||||
}
|
||||
|
||||
/* Debian/Ubuntu/Busybox interfaces file */
|
||||
/* Debian/Ubuntu/Busybox/RH/Suse */
|
||||
if (fexist("/sbin/ifup")) {
|
||||
/* interfaces file */
|
||||
fp = fopen("/etc/network/interfaces", "r");
|
||||
if (fp) {
|
||||
int i = 0;
|
||||
@@ -186,6 +188,7 @@ static void networking(void)
|
||||
if (i)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* Fall back to bring up at least loopback */
|
||||
ifconfig("lo", "127.0.0.1", "255.0.0.0", 1);
|
||||
|
||||
Reference in new issue
Block a user