Added lighttpd and renamed uname to linux for getting their versions.
This commit is contained in:
parent
760a67de3a
commit
f4a0473ff1
2 changed files with 20 additions and 2 deletions
18
lighttpd/lighttpd.lua
Normal file
18
lighttpd/lighttpd.lua
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
---
|
||||||
|
permalink: /cgi/lighttpd/index.lua
|
||||||
|
---
|
||||||
|
|
||||||
|
-- Function to execute shell commands
|
||||||
|
local function shell_exec(command)
|
||||||
|
local handle = io.popen(command)
|
||||||
|
local result = handle:read("*a")
|
||||||
|
handle:close()
|
||||||
|
return result
|
||||||
|
end
|
||||||
|
|
||||||
|
local lighttpd = shell_exec('lighttpd -v')
|
||||||
|
|
||||||
|
io.write("Content-Type: text/plain; charset=utf-8\r\n\r\n")
|
||||||
|
|
||||||
|
io.write(lighttpd:sub(10, 15))
|
||||||
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
permalink: /cgi/uname/index.lua
|
permalink: /cgi/linux/index.lua
|
||||||
---
|
---
|
||||||
|
|
||||||
-- Function to execute shell commands
|
-- Function to execute shell commands
|
||||||
|
|
@ -23,5 +23,5 @@ local res = string.sub(uname, 1, pos - 1)
|
||||||
io.write("Content-Type: text/plain; charset=utf-8\r\n\r\n")
|
io.write("Content-Type: text/plain; charset=utf-8\r\n\r\n")
|
||||||
|
|
||||||
-- Output the result
|
-- Output the result
|
||||||
io.write(res)
|
io.write(res:sub(7, 12))
|
||||||
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue