From 4f6638ad6f45bf328762f1ffbf864422d25fa523 Mon Sep 17 00:00:00 2001 From: Connor Olding Date: Wed, 3 Jul 2024 13:16:17 -0700 Subject: [PATCH] support more netcats --- sh/burl | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sh/burl b/sh/burl index 8c48820..c0ecc3e 100755 --- a/sh/burl +++ b/sh/burl @@ -35,12 +35,15 @@ burl() ( ### @- (: &- && net=y || net= [ $'' ] && 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 -- "$@" ;} - elif busybox nc; [ $? = 1 ] - then g() { f busybox nc -- "$@" ;} elif netcat; [ $? = 1 ] 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 then g() { f socat - "TCP:$1:$2" ;} elif curl; [ $? = 2 ]