print("YOU SHOULD USE THIS COMMAND WITH SUDO")
pc = get_shell.host_computer
httpd = include_lib("/lib/libhttp.so")
if not httpd then
exit "libhttp should be installed"
end if
if pc.File("/Public") == null then
print "installing http server"
output = httpd.install_service
if output != true then exit(output)
end if
httpd.start_service
if pc.File("/Public/htdocs/htmls") == null then
exit "ERROR: move htmls folder to /Public/htdocs"
end if
websites = pc.File("/Public/htdocs/htmls").get_files
while true
for f in websites
print("["+__f_idx + "] " + f.name)
end for
print("[q] EXIT")
opt = user_input("opt: ")
if opt == "q" then
httpd.stop_service
exit("[+] <color=red>Webserver closed")
else
opt = websites[opt.to_int]
html = pc.File("/Public/htdocs/website.html")
if html then html.set_content(opt.get_content)
clear_screen
print("[!] <color=orange>" + opt.name + " is up in " + pc.local_ip + char(10))
end if
end while