Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
Acme.Sh
Commits
a6f744ed
Commit
a6f744ed
authored
Jan 24, 2016
by
neil
Browse files
use nmap Ncat for centOS
parent
18629d0f
Changes
1
Show whitespace changes
Inline
Side-by-side
le.sh
View file @
a6f744ed
...
@@ -222,11 +222,15 @@ _setopt() {
...
@@ -222,11 +222,15 @@ _setopt() {
_startserver
()
{
_startserver
()
{
content
=
"
$1
"
content
=
"
$1
"
_NC
=
"nc -q 1"
if
nc
-h
|
grep
"nmap.org/ncat"
>
/dev/null
;
then
_NC
=
"nc"
fi
# while true ; do
# while true ; do
if
[
"
$DEBUG
"
]
;
then
if
[
"
$DEBUG
"
]
;
then
echo
-e
-n
"HTTP/1.1 200 OK
\r\n\r\n
$content
"
|
nc
-q
1
-l
-p
80
echo
-e
-n
"HTTP/1.1 200 OK
\r\n\r\n
$content
"
|
$_NC
-l
-p
80
-vv
else
else
echo
-e
-n
"HTTP/1.1 200 OK
\r\n\r\n
$content
"
|
nc
-q
1
-l
-p
80
>
/dev/null
echo
-e
-n
"HTTP/1.1 200 OK
\r\n\r\n
$content
"
|
$_NC
-l
-p
80
>
/dev/null
fi
fi
# done
# done
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment