mirror of
https://github.com/notwa/rc
synced 2025-02-05 07:43:22 -08:00
support more netcats
This commit is contained in:
parent
697e68d039
commit
4f6638ad6f
1 changed files with 6 additions and 3 deletions
9
sh/burl
9
sh/burl
|
@ -35,12 +35,15 @@ burl() ( ### @-
|
||||||
(: </dev/udp/localhost/0) 2>&- && net=y || net=
|
(: </dev/udp/localhost/0) 2>&- && net=y || net=
|
||||||
[ $'' ] && r=$(printf \\r) || r=$'\r'
|
[ $'' ] && r=$(printf \\r) || r=$'\r'
|
||||||
|
|
||||||
if /usr/bin/env nc; [ $? = 1 ] # needs absolute path to env thanks to busybox
|
# nc.traditional needs the -- or else it waits for input.
|
||||||
|
if /usr/bin/env nc --; [ $? = 1 ] # needs absolute path to env thanks to busybox
|
||||||
then g() { f /usr/bin/env nc -- "$@" ;}
|
then g() { f /usr/bin/env nc -- "$@" ;}
|
||||||
elif busybox nc; [ $? = 1 ]
|
|
||||||
then g() { f busybox nc -- "$@" ;}
|
|
||||||
elif netcat; [ $? = 1 ]
|
elif netcat; [ $? = 1 ]
|
||||||
then g() { f netcat -- "$@" ;}
|
then g() { f netcat -- "$@" ;}
|
||||||
|
elif ncat; [ $? = 1 ]
|
||||||
|
then g() { f ncat -- "$@" ;}
|
||||||
|
elif busybox nc; [ $? = 1 ]
|
||||||
|
then g() { f busybox nc -- "$@" ;}
|
||||||
elif socat /dev/null /dev/null
|
elif socat /dev/null /dev/null
|
||||||
then g() { f socat - "TCP:$1:$2" ;}
|
then g() { f socat - "TCP:$1:$2" ;}
|
||||||
elif curl; [ $? = 2 ]
|
elif curl; [ $? = 2 ]
|
||||||
|
|
Loading…
Add table
Reference in a new issue