Skip to content

Commit

Permalink
Merge pull request #69 from ipitio/master
Browse files Browse the repository at this point in the history
Better history management
  • Loading branch information
arevindh authored Jan 22, 2024
2 parents d189ef6 + c4c0a5e commit 243e045
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 24 deletions.
27 changes: 6 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,13 @@
## This project is part of
# Pihole Speedtest Mod

https://github.com/arevindh/pihole-speedtest
[![Join the chat at https://gitter.im/pihole-speedtest/community](https://badges.gitter.im/pihole-speedtest/community.svg)](https://gitter.im/pihole-speedtest/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Discord](https://badgen.net/badge/icon/discord?icon=discord&label)](https://discord.gg/TW9TfyM)

## About the project
Test your connection speed directly in the Pi-hole web interface!

This project is just another fun project integrating speedtest to PiHole Web UI.
Please go to the [main repository](https://github.com/arevindh/pihole-speedtest) for more information, including installation instructions, pull requests, and issues.

It will be using speedtest.net on background for testing. More frequent the speed tests more data will used.

What does this mod have in extra ?

1. Speedtest results of 1/2/4/7/30 days as graph.
2. Custom speed test server selection.
3. Detailed speedtest results page.
4. Ability to schedule speedtest interval.

## Wiki

Wiki is available here https://github.com/arevindh/pihole-speedtest/wiki
[Uninstall Instructions](https://github.com/arevindh/pihole-speedtest/wiki/Uninstalling-Speedtest-Mod)

## Disclaimer

We are not affiliated or endorced by [Pi-hole](https://github.com/pi-hole/AdminLTE)

## Use Official CLI Mode for best results.

[Uninstall Instructions](https://github.com/arevindh/pihole-speedtest/wiki/Uninstalling-Speedtest-Mod)
We are not affiliated or endorsed by [Pi-hole](https://github.com/pi-hole/AdminLTE)
15 changes: 12 additions & 3 deletions advanced/Scripts/webpage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Options:
-i, interface Specify dnsmasq's interface listening behavior
-s, speedtest Set speedtest interval, user 0 to disable Speedtests, use -sn to prevent logging to results list
-in Reinstall Speedtest Mod
-up [un] [db] Update Pi-hole (and | but uninstall) the Mod (and flush the database)
-up [un] [db] Update Pi-hole and (uninstall) the Mod (and flush the database)
-un [db] Uninstall Speedtest Mod without updating Pi-hole (and delete the database)
-db Flush the database
-sd Set speedtest display range
Expand Down Expand Up @@ -545,9 +545,18 @@ SetWebUILayout() {
addOrEditKeyValPair "${setupVars}" "WEBUIBOXEDLAYOUT" "${args[2]}"
}

hashFile() {
md5sum "$1" | cut -d ' ' -f 1
}

ClearSpeedtestData() {
mv $speedtestdb $speedtestdb.old
cp /var/www/html/admin/scripts/pi-hole/speedtest/speedtest.db $speedtestdb
init_db=/var/www/html/admin/scripts/pi-hole/speedtest/speedtest.db
if [[ -f $speedtestdb.old ]] && [[ $(hashFile $init_db) == $(hashFile $speedtestdb) ]]; then
mv -f $speedtestdb.old $speedtestdb
else
mv -f $speedtestdb $speedtestdb.old
cp $init_db $speedtestdb
fi
}

ChangeSpeedTestSchedule() {
Expand Down

0 comments on commit 243e045

Please sign in to comment.