mirror of https://github.com/sipwise/ngcpcfg.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
751 B
35 lines
751 B
[%
|
|
# vi: ft=tt2
|
|
|
|
# Returns a list of IPs to ping.
|
|
#
|
|
# @param argv.gw A boolean selecting whether to add GW IP.
|
|
# @param argv.dns A boolean selecting whether to add DNS IPs.
|
|
# @return out List of pingnodes.
|
|
|
|
host = ngcp.get_hostname();
|
|
out = [];
|
|
|
|
FOREACH iface IN hosts.${host}.interfaces;
|
|
FOREACH realiface IN hosts.${host}.keys;
|
|
IF realiface == iface;
|
|
IF hosts.${host}.$realiface.gateway;
|
|
|
|
IF argv.gw == 'yes';
|
|
out.push(hosts.${host}.$realiface.gateway);
|
|
END;
|
|
|
|
IF argv.dns == 'yes';
|
|
FOREACH dns_server_ip IN hosts.${host}.${realiface}.dns_nameservers;
|
|
out.push(dns_server_ip);
|
|
END;
|
|
END;
|
|
|
|
END;
|
|
END;
|
|
END;
|
|
END;
|
|
|
|
out = out.sort;
|
|
|
|
-%] |