From 130a0b025faa597eb4f5dd1a1bbebd395eeb84dc Mon Sep 17 00:00:00 2001 From: Henrik Riomar Date: Thu, 21 Apr 2022 13:35:33 +0200 Subject: [PATCH] fix bashisms in Alibaba checks --- virt-what.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/virt-what.in b/virt-what.in index d56c84f..ab04592 100644 --- a/virt-what.in +++ b/virt-what.in @@ -116,7 +116,7 @@ arch=$(uname -m | sed -e 's/i.86/i386/' | sed -e 's/arm.*/arm/') # Check for Alibaba Cloud if echo "$dmi" | grep -q 'Manufacturer: Alibaba'; then # Check for Alibaba Cloud ECS Bare Metal (EBM) Instance - if ( { echo -e "GET /latest/meta-datainstance/instance-type HTTP/1.0\r\nHost: 100.100.100.200\r\n\r" >&3; grep -sq 'ebm' <&3 ; } 3<> /dev/tcp/100.100.100.200/80 ) 2>/dev/null ; then + if ( printf "%b\n" "GET /latest/meta-datainstance/instance-type HTTP/1.0\r\nHost: 100.100.100.200\r\n\r" | nc -w1 100.100.100.200 80 | grep -sq 'ebm' ) 2>/dev/null ; then echo "alibaba_cloud-ebm" else echo "alibaba_cloud" -- 2.35.2