summaryrefslogtreecommitdiff
path: root/hscript/script_e.cc
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2020-07-04 08:56:03 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2020-07-04 08:56:03 -0500
commit1d9c703a8eebcf8f328e610879c7a1799258bba3 (patch)
tree5c1a84c61e4277e931effe8c2aea25b20932936a /hscript/script_e.cc
parentb0690189d37cb96924fd52e6647f84020ba56ef6 (diff)
downloadhorizon-1d9c703a8eebcf8f328e610879c7a1799258bba3.tar.gz
horizon-1d9c703a8eebcf8f328e610879c7a1799258bba3.tar.bz2
horizon-1d9c703a8eebcf8f328e610879c7a1799258bba3.tar.xz
horizon-1d9c703a8eebcf8f328e610879c7a1799258bba3.zip
hscipt: Implement parse and validation of 'pppoe' key
Diffstat (limited to 'hscript/script_e.cc')
-rw-r--r--hscript/script_e.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/hscript/script_e.cc b/hscript/script_e.cc
index 866a836..87ade0f 100644
--- a/hscript/script_e.cc
+++ b/hscript/script_e.cc
@@ -287,7 +287,7 @@ bool Script::execute() const {
}
bool dhcp = false;
- if(!internal->addresses.empty()) {
+ if(!internal->addresses.empty() || !internal->pppoes.empty()) {
fs::path conf_dir, targ_netconf_dir, targ_netconf_file;
switch(netconfsys) {
case NetConfigType::Netifrc:
@@ -319,6 +319,13 @@ bool Script::execute() const {
if(addr->type() == NetAddress::DHCP) dhcp = true;
}
+ int pppcnt = 0;
+ for(auto &ppp_link : internal->pppoes) {
+ EXECUTE_OR_FAIL("pppoe", ppp_link);
+ ifaces.insert(ppp_link->iface());
+ ifaces.insert("ppp" + std::to_string(pppcnt++));
+ }
+
std::ostringstream conf;
if(netconfsys == NetConfigType::ENI) {