summaryrefslogtreecommitdiff
path: root/hscript/script_e.cc
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2020-06-24 00:39:58 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2020-06-24 00:39:58 -0500
commitf269dabec9ea44084692991877eacda60d78c355 (patch)
tree27ff2a7ada30c3751e46b42983960aa416c08434 /hscript/script_e.cc
parent993d5eec1d22730b6e01f1d62551167cb6064c68 (diff)
downloadhorizon-f269dabec9ea44084692991877eacda60d78c355.tar.gz
horizon-f269dabec9ea44084692991877eacda60d78c355.tar.bz2
horizon-f269dabec9ea44084692991877eacda60d78c355.tar.xz
horizon-f269dabec9ea44084692991877eacda60d78c355.zip
Fix network state issue on live installs, and firmware install
Diffstat (limited to 'hscript/script_e.cc')
-rw-r--r--hscript/script_e.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/hscript/script_e.cc b/hscript/script_e.cc
index cf004a0..b8087e6 100644
--- a/hscript/script_e.cc
+++ b/hscript/script_e.cc
@@ -485,7 +485,11 @@ bool Script::execute() const {
+ iface, ec.message());
EXECUTE_FAILURE("network");
} else {
- run_command("service", {"net." + iface, "start"});
+ std::ifstream statefs("/sys/class/net/" + iface + "/operstate");
+ char state;
+ statefs.read(&state, 1);
+ if(state != 'u')
+ run_command("service", {"net." + iface, "start"});
}
}
break;