From 0be2ef3dff28a47f3861afcceab97873aef1ed70 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 d090898..96c7606 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 [ "x$root" = "x" ] && ( { 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 [ "x$root" = "x" ] && ( 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.37.1