HEX
Server: Apache/2.4.63 (Unix)
System: Linux TOMS-220NAS 4.4.302+ #86009 SMP Wed Nov 26 18:19:17 CST 2025 x86_64
User: flavio87 (1026)
PHP: 8.3.27
Disabled: NONE
Upload Files
File: //usr/syno/synodr/sbin/TestDownloadSpeed.sh
#!/bin/sh
# Copyright (c) 2000-2015 Synology Inc. All rights reserved.

if [ $# -ne 3 ]; then
	echo "argument number should be 3"
	exit 254
fi

URL=$1
TRIES=$2	# number of retries passed to wget's `--tries`
TIMEOUT=$3	# timeout in second, passed to wget's `--timeout`

# get the last two line of the output
# strip the date time info
# match (??? ?B/s) and preserve the error message.
wget --delete-after --no-check-certificate "$URL" "--tries=$2" "--timeout=$3" 2>&1 | grep "^[0-9]\+-" \
	| cut -d " " -f 3- \
	| sed "s/^[^(]*(\([0-9.]\+ [KM]\?B\/s\)).*$/\1/g" | tr -d "\n"