Skript zur Bandbreitenmessung
This commit is contained in:
parent
0d1a6a13dd
commit
8b99133173
2 changed files with 39 additions and 1 deletions
|
@ -2,5 +2,5 @@ Network News Monitor
|
||||||
Development Java Qt GTK Motif Utility
|
Development Java Qt GTK Motif Utility
|
||||||
Graphics VectorGraphics Rastergraphics OCR
|
Graphics VectorGraphics Rastergraphics OCR
|
||||||
Construction 3DGraphics
|
Construction 3DGraphics
|
||||||
Engineering Construction 3DGraphics Geology Physics
|
Engineering Construction 3DGraphics Geology Physics Electronics
|
||||||
Graphics FlowChart
|
Graphics FlowChart
|
||||||
|
|
38
netz-tools/ermittle-bandbreite.sh
Executable file
38
netz-tools/ermittle-bandbreite.sh
Executable file
|
@ -0,0 +1,38 @@
|
||||||
|
#!/bin/ash
|
||||||
|
#
|
||||||
|
# Ermittlung der aktuellen Download-Rate der Internet-Verbindung
|
||||||
|
#
|
||||||
|
# Vorgehensweise:
|
||||||
|
# - grosse Datei fuer X Sekunden herunterladen und Bytes zaehlen
|
||||||
|
# - Anzahl der Bytes durch die Anzahl der Sekunden teilen
|
||||||
|
#
|
||||||
|
# Probleme:
|
||||||
|
# - Namensaufloesung kostet Zeit, die nicht beruecksichtigt wird
|
||||||
|
# - unklar, ob parallel andere Netzzugriffe stattfinden
|
||||||
|
# - die Bandbreite wird fuer den Testzeitraum vollstaendig gefressen
|
||||||
|
#
|
||||||
|
|
||||||
|
|
||||||
|
URL="http://ftp.suse.com/pub/suse/i386/live-cd-9.2/SUSE-Linux-9.2-LiveDVD.iso"
|
||||||
|
TIMEOUT=60
|
||||||
|
|
||||||
|
# undefinierte Variablen fuehren zum Abbruch (debug)
|
||||||
|
set -u
|
||||||
|
|
||||||
|
# Fehlermeldungen und Prozessausgaben ("TERMINATED") unterdruecken
|
||||||
|
exec 2>/dev/null
|
||||||
|
|
||||||
|
ermittle_download_bytes()
|
||||||
|
{
|
||||||
|
(wget -q --output-document=- "$URL" 2>/dev/null | wc -c) &
|
||||||
|
sleep $TIMEOUT
|
||||||
|
killall wget
|
||||||
|
}
|
||||||
|
|
||||||
|
ermittle_download_rate()
|
||||||
|
{
|
||||||
|
local BYTES=`ermittle_download_bytes`
|
||||||
|
echo "$(($BYTES/$TIMEOUT))"
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "`date` - `ermittle_download_rate`"
|
Loading…
Reference in a new issue