diff options
Diffstat (limited to 'hscript/script_e.cc')
-rw-r--r-- | hscript/script_e.cc | 6 |
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; |