{"id":34636869,"url":"https://github.com/mapi68/pihole-script","last_synced_at":"2026-05-08T02:14:48.194Z","repository":{"id":132905150,"uuid":"425714563","full_name":"mapi68/pihole-script","owner":"mapi68","description":"Scripts to customize the number of displayed queries in Pi-hole's dashboard (v5/v6)","archived":false,"fork":false,"pushed_at":"2025-03-31T05:40:09.000Z","size":283,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-31T06:27:22.513Z","etag":null,"topics":["pi-hole","raspberry-pi"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mapi68.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-08T05:53:53.000Z","updated_at":"2025-03-31T05:40:12.000Z","dependencies_parsed_at":"2024-02-03T05:21:54.729Z","dependency_job_id":"d907ee26-4a1c-4394-8da3-ec7582a02ded","html_url":"https://github.com/mapi68/pihole-script","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mapi68/pihole-script","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mapi68%2Fpihole-script","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mapi68%2Fpihole-script/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mapi68%2Fpihole-script/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mapi68%2Fpihole-script/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mapi68","download_url":"https://codeload.github.com/mapi68/pihole-script/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mapi68%2Fpihole-script/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28005408,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-24T02:00:07.193Z","response_time":83,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["pi-hole","raspberry-pi"],"created_at":"2025-12-24T17:02:56.487Z","updated_at":"2026-05-08T02:14:48.184Z","avatar_url":"https://github.com/mapi68.png","language":"Shell","funding_links":["https://ko-fi.com/mapi68"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" alt=\"License: MIT\"/\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Shell-100%25-brightgreen.svg\" alt=\"Shell Script\"/\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003e🛠️ Pi-hole Scripts Collection\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003eA collection of utility scripts to extend and customize your Pi-hole installation.\u003c/strong\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#overview\"\u003eOverview\u003c/a\u003e •\n  \u003ca href=\"#scripts\"\u003eScripts\u003c/a\u003e •\n  \u003ca href=\"#install\"\u003eInstall\u003c/a\u003e •\n  \u003ca href=\"#usage\"\u003eUsage\u003c/a\u003e •\n  \u003ca href=\"#troubleshooting\"\u003eTroubleshooting\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://ko-fi.com/mapi68\"\u003e\n    \u003cimg src=\"https://ko-fi.com/img/githubbutton_sm.svg\" alt=\"Support on Ko-fi\"/\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n---\n\n## 🌟 Overview \u003ca name=\"overview\"\u003e\u003c/a\u003e\n\nA growing collection of Bash scripts to manage, customize, and extend Pi-hole beyond its default capabilities — including dashboard tweaks, cron job management, and live system monitoring.\n\n---\n\n## 📦 Scripts \u003ca name=\"scripts\"\u003e\u003c/a\u003e\n\n### 📊 1. Pi-hole Query Number Modifier\n\nModify how many entries are displayed in the Pi-hole dashboard (Top Permitted Domains, Top Blocked Domains, Top Clients).\n\n#### Features\n\n| Feature | Description |\n|---|---|\n| 🔄 **Reset** | Restore default values (10 queries) |\n| ⚡ **Optimal Mode** | Predefined values tuned for medium-sized servers |\n| 🎛️ **Manual Mode** | Custom configuration from 10 to 99 queries |\n| 🎨 **Color Output** | Color-coded terminal interface |\n| 🖥️ **Interactive UI** | User-friendly guided setup |\n\n#### Configuration\n\n**Optimal Mode** — Sets Top Domains to 15 entries and Top Clients to 30 entries.\n\n![Optimal Mode](images/optimal.png)\n\n**Manual Mode** — Full control over all query number settings (10–99).\n\n![Manual Mode](images/manual.png)\n\n---\n\n### ⏰ 2. Pi-hole Cron Manager\n\nManage Pi-hole scheduled tasks from an interactive menu. Applies, removes, and monitors cron jobs for Pi-hole — with no manual editing of cron files required.\n\n#### Features\n\n| Feature | Description |\n|---|---|\n| ✅ **Apply / Restore** | Writes the default schedule to `/etc/cron.d/pihole_custom` and restarts cron |\n| 🗑️ **Remove** | Deletes the cron file with confirmation |\n| 📋 **Show Log** | Displays the last 30 lines of the updateGravity log |\n| ▶️ **Run Now** | Runs `updateGravity` immediately with live output |\n| 🖥️ **Interactive UI** | Menu-driven with return-to-menu after each action |\n\n#### Default Schedule\n\n```\n5 5 * * 1-6   root   pihole updateGravity \u003e /var/log/pihole_updateGravity.log\n```\n\n\u003e **updateGravity** runs Monday through Saturday at **05:05**, with output saved to `/var/log/pihole_updateGravity.log`.\n\n![Cron Manager](images/cron.png)\n\n---\n\n### 📡 3. Pi-hole Status Report\n\nA live terminal dashboard that auto-refreshes every 10 seconds, showing a full overview of your Pi-hole instance — functionality not available natively in Pi-hole.\n\n#### Features\n\n| Feature | Description |\n|---|---|\n| 🔄 **Live Refresh** | Auto-updates every 10 seconds |\n| 📦 **Versions** | Pi-hole and FTL current version |\n| ⏱️ **Uptime** | System uptime at a glance |\n| ⚙️ **Services** | Status of pihole-FTL and cron |\n| 📊 **Queries Today** | Total queries, blocked count, block rate with visual bar |\n| 🌍 **Gravity** | Number of domains in the gravity database |\n| 💾 **Resources** | RAM and disk usage with visual bars |\n| 🚫 **Top Blocked Domains** | Top 5 domains blocked today |\n| 🖥️ **Top Clients** | Top 5 clients by query count |\n\n#### Notes\n\n- Uses the Pi-hole REST API (`/api/`) for all data\n- Authenticates automatically via `/etc/pihole/cli_pw`\n- Press `Ctrl+C` to exit cleanly\n\n![Status Report](images/report.png)\n\n---\n\n## 📋 Prerequisites \u003ca name=\"prerequisites\"\u003e\u003c/a\u003e\n\n- Root access to your Pi-hole server\n- Running Pi-hole installation\n- Basic command line knowledge\n\n---\n\n## 🛠️ Install \u003ca name=\"install\"\u003e\u003c/a\u003e\n\n### Option 1 — Clone with Git\n\n```bash\ngit clone https://github.com/mapi68/pihole-script.git\ncd pihole-script\nchmod +x *.bash\n```\n\n### Option 2 — Download ZIP\n\n```bash\nwget https://github.com/mapi68/pihole-script/archive/refs/heads/master.zip\nunzip master.zip\nrm master.zip\ncd pihole-script-master\nchmod +x *.bash\n```\n\n---\n\n## 📝 Usage \u003ca name=\"usage\"\u003e\u003c/a\u003e\n\n### Query Number Modifier\n\n```bash\nsudo ./pihole-change-queries-number.bash\n```\n\n### Cron Manager\n\n```bash\nsudo ./pihole-cron-manager.bash\n```\n\n### Status Report\n\n```bash\nsudo ./pihole-status-report.bash\n```\n\nPress `Ctrl+C` to exit the live dashboard.\n\n---\n\n## ❗ Troubleshooting \u003ca name=\"troubleshooting\"\u003e\u003c/a\u003e\n\n- The query modifier script automatically re-downloads the original `index.js` from the Pi-hole repository before applying changes\n- Error messages are color-coded for easy identification\n- Invalid inputs are handled gracefully with clear error messages\n- The cron manager shows the current active schedule at startup before any action is taken\n- The status report authenticates automatically via `/etc/pihole/cli_pw`\n\n### Reverting Query Number Changes\n\nRun the script again and choose to exit after the reset step — this restores the default value of 10.\n\n### Reverting Cron Changes\n\nRun `pihole-cron-manager.bash` and choose option **2 (Remove)** to delete the custom cron file, or option **1 (Apply)** to restore the default schedule.\n\n---\n\n## 📄 License\n\nThis project is licensed under the [MIT License](LICENSE).\n\n---\n\n## 👤 Author\n\n- [@mapi68](https://github.com/mapi68)\n\nIf you encounter any issues or have questions, please [open an issue](https://github.com/mapi68/pihole-script/issues) on GitHub. Contributions and Pull Requests are welcome!\n\n---\n\n## ☕ Support\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://ko-fi.com/mapi68\"\u003e\n    \u003cimg src=\"https://ko-fi.com/img/githubbutton_sm.svg\" alt=\"Support on Ko-fi\"/\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n---\n\n\u003cp align=\"center\"\u003e\n  Made with ❤️ for the Raspberry Pi community\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmapi68%2Fpihole-script","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmapi68%2Fpihole-script","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmapi68%2Fpihole-script/lists"}