netcat doesnt work

hello

since the latest version of volumio i noticed that the netcat doesnt work anymore.
It return always the error 124 code.

sudo timeout 5s bash -c “nc -w 3 -vz 172.20.20.84 8000”

i have ±60 raspberry running on different location with volumio from year 2016 and these are running netcat perfect.

Any idea how to fix this ?

172.20.20.84 is an icecast server with darkice.

#!/bin/bash
firstrun=1
#sleep 5
#sudo /etc/init.d/dhcpcd restart
#$sleep 5
while true
do
#sudo ping -c 1 172.20.20.84
sudo timeout 5s bash -c “nc -w 3 -vz 172.20.20.84 8000”
reply=$?
sleep 5
printf “Reply result: %s\n\r” “$reply”
printf “firstrun value: %s\n\r” “$firstrun”
if [ $reply -eq 0 ];
then
printf “Ip found\n\r”
if [ $firstrun -eq 1 ];
then
firstrun=0
(sudo amixer -c 5 – sset Speaker,0 180 unmute;sudo mpc clear;sudo mpc add 172.20.20.84:8000/NonSync;sudo mpc volume 90;sudo mpc play)

fi

sleep 5

else
printf "Ip not found\n\r"
if [ $firstrun -eq 0 ];
	then
	mpc stop
	mpc clear
	#sudo shutdown -r now
	#pidof mpd
	#sudo kill $(pidof mpd)
	firstrun=1
fi

sleep 5

fi
sleep 10
done

Please send me an email to info at volumio dot org :wink:

hello

i had to use the netcat -w 3 -zv -n xx.xx.xx.xx xxxx.

-n solved the issue.