diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2020-03-11 11:44:42 -0500 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2020-03-11 11:44:42 -0500 |
commit | b8f4ce3bdb1f3ea76eef1c0c4fd7dd5d29259336 (patch) | |
tree | a95e0ccf5242a2c1a52b118dd04138a64d3f7546 /hscript/network.cc | |
parent | bcff79985ebe4c2d09eda749a99a005dc65b6b52 (diff) | |
download | horizon-b8f4ce3bdb1f3ea76eef1c0c4fd7dd5d29259336.tar.gz horizon-b8f4ce3bdb1f3ea76eef1c0c4fd7dd5d29259336.tar.bz2 horizon-b8f4ce3bdb1f3ea76eef1c0c4fd7dd5d29259336.tar.xz horizon-b8f4ce3bdb1f3ea76eef1c0c4fd7dd5d29259336.zip |
hscript: Make target directory configurable
This is the first step towards creating images using Horizon.
Diffstat (limited to 'hscript/network.cc')
-rw-r--r-- | hscript/network.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/hscript/network.cc b/hscript/network.cc index 3741b0c..1750a60 100644 --- a/hscript/network.cc +++ b/hscript/network.cc @@ -347,12 +347,14 @@ Key *Nameserver::parseFromData(const std::string &data, int lineno, bool Nameserver::execute() const { if(script->options().test(Simulate)) { std::cout << "printf 'nameserver %s\\" << "n' " << _value - << " >>/target/etc/resolv.conf" << std::endl; + << " >>" << script->targetDirectory() << "/etc/resolv.conf" + << std::endl; return true; } #ifdef HAS_INSTALL_ENV - std::ofstream resolvconf("/target/etc/resolv.conf", std::ios_base::app); + std::ofstream resolvconf(script->targetDirectory() + "/etc/resolv.conf", + std::ios_base::app); if(!resolvconf) { output_error("installfile:" + std::to_string(line), "nameserver: couldn't write configuration to target"); |