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.

15 lines
370 B

2 years ago
2 years ago
  1. local io = require("io")
  2. local serial = require("serialization")
  3. local dhcp = require("dhcp")
  4. local pkt, err = dhcp.query()
  5. if pkt == nil then
  6. print("Error: "..err)
  7. return
  8. end
  9. print("Received response from "..pkt.raddr)
  10. print("Writing to /etc/resolv.cfg")
  11. local f = io.open("/etc/resolv.cfg", "w")
  12. f:write(serial.serialize(pkt.data[2],5))
  13. f:close()