init repo
This commit is contained in:
commit
563c49ac76
3 changed files with 49 additions and 0 deletions
0
README.md
Normal file
0
README.md
Normal file
8
speedtest.log
Normal file
8
speedtest.log
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
===== 2025-12-30 10:59:35 =====
|
||||
Download: 862.24 Mbit/s
|
||||
Upload: 854.28 Mbit/s
|
||||
|
||||
===== 2025-12-30 11:00:57 =====
|
||||
Download: 828.09 Mbit/s
|
||||
Upload: 840.06 Mbit/s
|
||||
|
||||
41
speedtest.sh
Executable file
41
speedtest.sh
Executable file
|
|
@ -0,0 +1,41 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
LOG="speedtest.log"
|
||||
|
||||
if ! command -v speedtest >/dev/null 2>&1; then
|
||||
echo "speedtest not found, installing..."
|
||||
|
||||
|
||||
if [[ -f /etc/os-release ]]; then
|
||||
. /etc/os-release
|
||||
else
|
||||
echo "Cannot detect Linux distribution"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
case "$ID" in
|
||||
ubuntu|debian)
|
||||
echo "Detected Ubuntu/Debian"
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y curl
|
||||
curl -s https://packagecloud.io/install/repositories/ookla/speedtest-cli/script.deb.sh | sudo bash
|
||||
sudo apt-get install -y speedtest
|
||||
;;
|
||||
arch|cachyos)
|
||||
echo "Detected Arch Linux"
|
||||
sudo pacman -Sy --noconfirm speedtest-cli
|
||||
;;
|
||||
*)
|
||||
echo "Unsupported distribution: $ID"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
else
|
||||
echo "speedtest already installed"
|
||||
fi
|
||||
|
||||
{
|
||||
echo "===== $(date '+%Y-%m-%d %H:%M:%S') ====="
|
||||
speedtest --secure | grep -E '^(Hosted by|Download|Upload):'
|
||||
echo
|
||||
} | tee -a "$LOG"
|
||||
Loading…
Reference in a new issue