Update Speedtest.net Mini Automatically to Avoid Expiring

自动更新 Speedtest.net Mini 测速文件防止测速文件过期

#!/usr/bin/env bash
# Speedtest.net Auto Update Script
# Usage: Download the latest SpeedTest script monthly as in 1st of every month at 00:00
# 0 0 1 * * nice -n 19 bash /srv/www/speedtest.sh >/dev/null 2>&1
# Make sure speedtest.sh is executable
# chmod +x /srv/www/speedtest.sh
DES_PATH=/usr/share
PUB_PATH=/srv/www/speedtest.tokyo.sparanoid.com/public_html
ST_DIR=speedtest
wget http://c.speedtest.net/mini/mini.zip -O $DES_PATH/$ST_DIR.zip –limit-rate=200000k
unzip -o $DES_PATH/$ST_DIR.zip -d $DES_PATH/$ST_DIR
# Remove old public files
rm -rf $PUB_PATH/$ST_DIR
# Link from private directory to $ST_DIR in public directory
ln -sf $DES_PATH/$ST_DIR/mini $PUB_PATH/$ST_DIR
# Rename index-php.html to index.php
mv $DES_PATH/$ST_DIR/mini/index-php.html $DES_PATH/$ST_DIR/mini/index.php

view raw
speedtest.sh
hosted with ❤ by GitHub