Explorar o código

Add Lua script to exit the server

bel2125 %!s(int64=9) %!d(string=hai) anos
pai
achega
1473a00ce2
Modificáronse 1 ficheiros con 15 adicións e 0 borrados
  1. 15 0
      test/exit.lua

+ 15 - 0
test/exit.lua

@@ -0,0 +1,15 @@
+
+msg=[[<html><body>
+<p>Exit CivetWeb</p>
+</body></html>
+]]
+
+mg.write("HTTP/1.0 200 OK\r\n")
+mg.write("Connection: close\r\n")
+mg.write("Content-Length: " .. #msg .. "\r\n")
+mg.write("Content-Type: text/html\r\n")
+mg.write("\r\n")
+mg.write(msg)
+
+os.exit(0)
+