Guest User

95_bind.lua

a guest
Dec 8th, 2014
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.29 KB | None | 0 0
  1. network = require("network")
  2. event = require("event")
  3. fs = require("filesystem")
  4.  
  5. function start()
  6. f = io.open("/etc/hostname")
  7. name = f:read()
  8. f:close()
  9. network.ip.bind(name)
  10. print("Binding to hostname: "..name)
  11. end
  12.  
  13. if fs.exists("/etc/hostname") then
  14. event.listen("network_ready", start)
  15. end
Advertisement
Add Comment
Please, Sign In to add comment