summaryrefslogtreecommitdiff
path: root/hscript/script_e.cc
diff options
context:
space:
mode:
Diffstat (limited to 'hscript/script_e.cc')
-rw-r--r--hscript/script_e.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/hscript/script_e.cc b/hscript/script_e.cc
index 8f0f4b4..50f92e1 100644
--- a/hscript/script_e.cc
+++ b/hscript/script_e.cc
@@ -678,14 +678,14 @@ bool Script::execute() const {
EXECUTE_OR_FAIL("svcenable", svc)
}
#ifdef HAS_INSTALL_ENV
- if(!opts.test(Simulate)) {
- const std::set<std::string> def_runlevels{
+ if(!opts.test(Simulate) && fs::exists(targ_etc + "/runlevels", ec)) {
+ const std::set<std::string> def_runlevels{
"boot", "default", "empty", "nonetwork", "shutdown", "sysinit"
};
- const auto rl_dir{targ_etc + "/runlevels"};
+ const auto rl_dir{targ_etc + "/runlevels"};
for(auto &&file : fs::directory_iterator(rl_dir)) {
const auto runlevel{file.path().filename().string()};
- if(def_runlevels.find(runlevel) == def_runlevels.end()) {
+ if(def_runlevels.find(runlevel) == def_runlevels.end()) {
fs::create_symlink("../default",
rl_dir + "/" + runlevel + "/default", ec);
if(ec) {