Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- path='/web/'
- os.loadAPI('ip')
- if not ip.open() then
- print('No modem found')
- return
- end
- if not ip.getIP() then
- print('Can not register in Craftnet')
- return
- end
- while true do
- m,i=ip.receive()
- if i then
- if m=='' then m='index' end
- print(i,' ',m)
- file=fs.open(path..m,'r')
- if not file then file=fs.open(path..'404','r') end
- if file then
- text=file.readAll() file.close()
- else
- text='Can not open file'
- end
- ip.send(i,text)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement