local-etc-hosts-updater/src/main.zig

12 lines
324 B
Zig
Raw Normal View History

2024-05-10 11:54:16 +05:00
const std = @import("std");
2024-05-10 12:49:51 +05:00
const util = @import("util.zig");
const mdns = @import("mdns.zig");
const hosts = @import("hosts.zig");
2024-05-10 11:54:16 +05:00
pub fn main() !void {
2024-05-10 12:49:51 +05:00
try util.check_perms();
const domain, const ip_ver = try util.get_input();
2024-05-10 12:49:51 +05:00
const ips = try mdns.get_mdns(domain);
try hosts.update_hosts(ips, ip_ver);
2024-05-10 11:54:16 +05:00
}