summaryrefslogtreecommitdiff
path: root/hscript/script_e.cc
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2020-02-11 04:57:46 -0600
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2020-02-11 04:57:46 -0600
commit9e22e871de6e69026c8eebb1d966fa1f0c2edfcc (patch)
treea9785fdb95b2698803057e0fdd7c6ec16b50c4f5 /hscript/script_e.cc
parentd8565f987dab41cf98b689058826d522d49bc265 (diff)
downloadhorizon-9e22e871de6e69026c8eebb1d966fa1f0c2edfcc.tar.gz
horizon-9e22e871de6e69026c8eebb1d966fa1f0c2edfcc.tar.bz2
horizon-9e22e871de6e69026c8eebb1d966fa1f0c2edfcc.tar.xz
horizon-9e22e871de6e69026c8eebb1d966fa1f0c2edfcc.zip
hscript: Turn on network interfaces in Install Env when network is true
Diffstat (limited to 'hscript/script_e.cc')
-rw-r--r--hscript/script_e.cc14
1 files changed, 13 insertions, 1 deletions
diff --git a/hscript/script_e.cc b/hscript/script_e.cc
index 2ae48d0..402eb88 100644
--- a/hscript/script_e.cc
+++ b/hscript/script_e.cc
@@ -21,6 +21,7 @@
#include "script.hh"
#include "script_i.hh"
+#include "util.hh"
#include "util/filesystem.hh"
namespace Horizon {
@@ -395,6 +396,17 @@ bool Script::execute() const {
EXECUTE_FAILURE("network");
return false;
}
+ for(auto &iface : ifaces) {
+ fs::create_symlink("/etc/init.d/net.lo",
+ "/etc/init.d/net." + iface, ec);
+ if(ec) {
+ output_error("internal", "could not use networking on "
+ + iface, ec.message());
+ EXECUTE_FAILURE("network");
+ } else {
+ run_command("service", {"net." + iface, "start"});
+ }
+ }
if(!internal->nses.empty()) {
if(dhcp) {
fs::copy_file("/target/etc/resolv.conf.head",
@@ -498,7 +510,7 @@ bool Script::execute() const {
iface, ec);
if(ec) {
output_error("internal", "could not auto-start "
- "networking on" + iface, ec.message());
+ "networking on " + iface, ec.message());
}
}
}