Merge pull request #7409 from gblues/master

wiiu: small cleanup
This commit is contained in:
Twinaphex 2018-10-10 21:13:28 +02:00 committed by GitHub
commit e9752fb546
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 5 deletions

View File

@ -44,8 +44,8 @@ struct sockaddr
};
/* Wii U only supports IPv4 so we make sockaddr_storage
+ be sockaddr_in for compatibility.
+ */
be sockaddr_in for compatibility.
*/
#define sockaddr_storage sockaddr_in
struct linger

View File

@ -6,7 +6,28 @@
#
# If you would like a logfile, pipe this script's output to tee.
script_dir=$(dirname $(readlink -f $0))
NETCAT=
find_netcat()
{
NETCAT=$(which netcat 2>/dev/null |grep '/')
if [ -z "$NETCAT" ]; then
NETCAT=$(which nc 2>/dev/null |grep '/')
if [ -z "$NETCAT" ]; then
echo "Failed to find either 'netcat' or 'nc'. Please install it."
exit 1
fi
fi
}
do_readlink()
{
local exe=$1
echo "$(cd $(dirname $exe) && pwd)"
}
find_netcat
script_dir=$(do_readlink $0)
IP=$(which ip 2>/dev/null | grep '^/')
IFCONFIG=$(which ifconfig 2>/dev/null | grep '^/')
@ -54,8 +75,8 @@ echo "Listening for UDP packets on broadcast IP: $broadcast"
while [ $exit_listen_loop -eq 0 ]; do
echo ========= `date` =========
if [ -z "$TS" ]; then
netcat -kluw 0 $broadcast $PC_DEVELOPMENT_TCP_PORT
$NETCAT -kluw 0 $broadcast $PC_DEVELOPMENT_TCP_PORT
else
netcat -kluw 0 $broadcast $PC_DEVELOPMENT_TCP_PORT |ts '[%Y-%m-%d %H:%M:%.S]'
$NETCAT -kluw 0 $broadcast $PC_DEVELOPMENT_TCP_PORT |ts '[%Y-%m-%d %H:%M:%.S]'
fi
done