OpenComputers Von Neumann Machine Programs
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.

16 lines
370 B

local io = require("io")
local serial = require("serialization")
local dhcp = require("dhcp")
local pkt, err = dhcp.query()
if pkt == nil then
print("Error: "..err)
return
end
print("Received response from "..pkt.raddr)
print("Writing to /etc/resolv.cfg")
local f = io.open("/etc/resolv.cfg", "w")
f:write(serial.serialize(pkt.data[2],5))
f:close()