1
0
Fork 0
mirror of https://github.com/albfan/miraclecast.git synced 2025-02-12 19:51:54 +00:00
miraclecast/res/test-hardware-capabilities.sh
Fernando van Loenhout a1590ecc17 Support more than 2 devices when testing the capabilities
At the moment, this typo is preventing the test script from working when you have more than 2 devices plugged in. Fixes #449
2022-09-19 10:59:02 +02:00

61 lines
980 B
Bash
Executable file

#!/bin/bash
eval SCRIPT_DEBUG="\$$(basename $0 .sh | tr - _)_DEBUG"
SCRIPT_DEBUG=${SCRIPT_DEBUG:--1}
if [ "$SCRIPT_DEBUG" -ge 1 ]
then
set -x
fi
if [ "$SCRIPT_DEBUG" -ge 10 ]
then
set -v
fi
. ./miracle-utils.sh
WIFI_COUNT=0
WIFI_NAMES="$(find_wireless_network_interfaces)"
if [ -n "$WIFI_NAMES" ]
then
WIFI_COUNT=$(echo "$WIFI_NAMES" | wc -l)
fi
if [ 0 = $WIFI_COUNT ]
then
echo There is no wireless devices available
exit 1
elif [ 1 = $WIFI_COUNT ]
then
WIFI_NAME="$WIFI_NAMES"
elif [ 2 -le $WIFI_COUNT ]
then
echo Choose wireless device:
PS3="device: "
QUIT="exit"
select wi_name in $WIFI_NAMES $QUIT
do
case $wi_name
in
"$QUIT")
exit
;;
"")
if [ "$REPLY" = $QUIT ]
then
exit
else
echo unknow $REPLY
fi
;;
*)
WIFI_NAME=$wi_name
break
;;
esac
done
fi
search_p2p_capabilities $WIFI_NAME