mirror of
https://github.com/nmap/nmap.git
synced 2026-08-04 14:49:29 +00:00
Make test-environment.lua a bit more straightforward.
This commit is contained in:
parent
35e118802b
commit
5657e7e00b
1 changed files with 9 additions and 5 deletions
|
|
@ -1,9 +1,13 @@
|
|||
#!/usr/bin/lua
|
||||
|
||||
--Print the following NCAT_* variables and their values:
|
||||
envs = {'REMOTE_ADDR', 'REMOTE_PORT', 'LOCAL_ADDR', 'LOCAL_PORT', 'PROTO'}
|
||||
|
||||
for _,v in pairs(envs) do
|
||||
v = 'NCAT_' .. v
|
||||
function print_env(v)
|
||||
print(("%s=%s"):format(v, os.getenv(v)))
|
||||
end
|
||||
|
||||
print_env("NCAT_REMOTE_ADDR")
|
||||
print_env("NCAT_REMOTE_PORT")
|
||||
|
||||
print_env("NCAT_LOCAL_ADDR")
|
||||
print_env("NCAT_LOCAL_PORT")
|
||||
|
||||
print_env("NCAT_PROTO")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue