Commit graph

260 commits

Author SHA1 Message Date
Christian König
b486786041
Add database healthy checks to debug script
Fix health check output comparison in gravity script as well
Add note about waiting time

Signed-off-by: Christian König <ckoenig@posteo.de>
2022-07-10 23:32:47 +02:00
Christian König
2c5907a8b1
Requiere sudo for pihole -t
Signed-off-by: Christian König <ckoenig@posteo.de>
2022-06-19 23:25:53 +02:00
Adam Warner
36dd533ef3 use directory /var/log/pihole/ for log storage
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2022-05-15 06:46:23 +02:00
Adam Warner
db116971ce
I tried to do too many things in one function, vastly overcomplicating what should have been _this_ all along
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2022-04-14 22:53:38 +01:00
Adam Warner
86dd612882
remove readonly directive from declaration of utilsfile, it is unnecassery
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2022-04-12 17:13:50 +01:00
yubiuser
42d3368955
Merge pull request #4663 from pi-hole/no_root
Only use sudo power if needed
2022-04-10 12:34:05 +02:00
Adam Warner
4d31d5ee11
Address review comments
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2022-04-04 22:02:26 +01:00
yubiuser
6121c162ff
Fix typo
Co-authored-by: Marius Hanl <66004280+Maran23@users.noreply.github.com>
2022-04-03 13:49:43 +02:00
Adam Warner
7fa8cdd03e
Address:
- Review Comments
 - Stickler Complaints
2022-04-02 12:46:07 +01:00
Christian König
722a716de3
Add exit code to status function
Signed-off-by: Christian König <ckoenig@posteo.de>
2022-03-30 22:40:14 +02:00
Christian König
614d18cd3d
Debug need sudo
Signed-off-by: Christian König <ckoenig@posteo.de>
2022-03-30 21:24:51 +02:00
Christian König
54ce8c2622
Only use sudo power if needed
Signed-off-by: Christian König <ckoenig@posteo.de>
2022-03-30 21:04:36 +02:00
Christian König
42424b515b Add getFTLAPIPort function
Add ftl_api_port function

Signed-off-by: Christian König <ckoenig@posteo.de>

Use getFTLAPIPort in pihole

Signed-off-by: Christian König <ckoenig@posteo.de>

Use default portfile as fallback

Signed-off-by: Christian König <ckoenig@posteo.de>

Fix stickler

Signed-off-by: Christian König <ckoenig@posteo.de>

Correct variables

Signed-off-by: Christian König <ckoenig@posteo.de>

Apply suggestions from code review

Co-authored-by: DL6ER <DL6ER@users.noreply.github.com>

Add test getFTLAPIPort returing default port

Signed-off-by: Christian König <ckoenig@posteo.de>

Remove unused code from test_key_val_replacement_works

Signed-off-by: Christian König <ckoenig@posteo.de>

Add getFTLAPIPort_custom test

Signed-off-by: Christian König <ckoenig@posteo.de>

Fix output format

Signed-off-by: Christian König <ckoenig@posteo.de>

Add debugging

Signed-off-by: Christian König <ckoenig@posteo.de>

Remove debugging and fix function

Signed-off-by: Christian König <ckoenig@posteo.de>
2022-02-27 18:16:53 +01:00
Adam Warner
77e5121d43
Split new function out into a separte utility script and add a test for it. Can be used in future to organise re/commonly-used code
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2022-01-30 23:05:28 +00:00
Adam Warner
1dd9d55d82
Replace value for BLOCKING_ENABLED (and QUERY_LOGGING, for consistency) and if value that we are trying to replace does not exist, add it to the end of the file.
Co-authored-by: MichaIng <micha@dietpi.com>
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2022-01-30 15:53:03 +00:00
Lukas Schlötterer
ed6b85241b
use sed substitute instead of delete and append (#4555)
* use sed substitute instead of delete and append

doesn't move the line to the end of the file, instead keeps the order of the lines in setupVars.conf intact

Signed-off-by: Lukas Schlötterer <80917404+lschloetterer@users.noreply.github.com>

* Match start of line

as suggested in the review

Signed-off-by: Lukas Schlötterer <80917404+lschloetterer@users.noreply.github.com>

Co-authored-by: yubiuser <ckoenig@posteo.de>

Co-authored-by: yubiuser <ckoenig@posteo.de>
2022-01-12 09:23:13 +01:00
DL6ER
5823f5e254
Use ss instead of lsof (#4518)
* Use ss instead of lsof for pihole status checks

Signed-off-by: DL6ER <dl6er@dl6er.de>

* Use ss FILTER instead of piping into bash

Signed-off-by: DL6ER <dl6er@dl6er.de>

* Use ss in debug log generation

Signed-off-by: DL6ER <dl6er@dl6er.de>

* Remove lsof from dependencies

Signed-off-by: DL6ER <dl6er@dl6er.de>
2022-01-05 16:41:46 +00:00
Christian König
3989cc19e9
Remove double text output
Signed-off-by: Christian König <ckoenig@posteo.de>
2021-12-28 19:55:42 +01:00
Christian König
bcb59159ed
Analyse port also on ports other than 53
Signed-off-by: Christian König <ckoenig@posteo.de>
2021-12-28 19:52:11 +01:00
Christian König
2b52f92647
Inlcude port also in cli output
Signed-off-by: Christian König <ckoenig@posteo.de>
2021-12-28 19:36:32 +01:00
Christian König
f45248df80
Use FTL's new dns-port API endpoint
Signed-off-by: Christian König <ckoenig@posteo.de>
2021-12-28 13:42:19 +01:00
Christian König
5729f64ddc
Fix missing fi
Signed-off-by: Christian König <ckoenig@posteo.de>
2021-12-28 12:21:31 +01:00
yubiuser
4a2f4c1bce
Fix indention_2
Co-authored-by: DL6ER <DL6ER@users.noreply.github.com>
2021-12-28 12:11:46 +01:00
yubiuser
5ef731fc57
Fix indention
Co-authored-by: DL6ER <DL6ER@users.noreply.github.com>
2021-12-28 12:11:26 +01:00
Christian König
71ebd64f4e
mend
Signed-off-by: Christian König <ckoenig@posteo.de>
2021-12-26 18:13:14 +01:00
Christian König
9f0e0dbd37
Fix analyse ports
Signed-off-by: Christian König <ckoenig@posteo.de>
2021-12-26 18:10:36 +01:00
Christian König
ef30a85afb
Include port in status function
Signed-off-by: Christian König <ckoenig@posteo.de>
2021-12-26 17:10:48 +01:00
yubiuser
ae39e338fe
Use exec to run gravity script (#4449)
Signed-off-by: Christian König <ckoenig@posteo.de>
2021-12-04 10:50:21 +01:00
Subhaditya Nath
ba6d700e7e
Fix pihole -v output if WebAdmin not installed (#4370)
* Fix https://github.com/pi-hole/pi-hole/issues/4279

Signed-off-by: Subhaditya Nath <sn03.general@gmail.com>

* Don't ignore exit code of version.sh

If it exits with a non-zero return code, that means some error occurred,
and so it shouldn't be ignored.

Signed-off-by: Subhaditya Nath <sn03.general@gmail.com>

* Implement changes suggested by @Michalng

Signed-off-by: Subhaditya Nath <sn03.general@gmail.com>

* Implement changes suggested by @PromoFaux

Signed-off-by: Subhaditya Nath <sn03.general@gmail.com>

* Always source /etc/pihole/setupVars.conf

https://github.com/pi-hole/pi-hole/pull/4370#issuecomment-978149567

Co-authored-by: Adam Warner <me@adamwarner.co.uk>
2021-12-02 20:46:11 +00:00
DL6ER
cbc99d45c6
Small style change to finished debug upload display
Signed-off-by: DL6ER <dl6er@dl6er.de>
2021-09-07 11:21:34 +02:00
DL6ER
be68a5339c
Apply same improvement to pihole tricorder feature
Signed-off-by: DL6ER <dl6er@dl6er.de>
2021-09-07 11:16:40 +02:00
DL6ER
115e3eeda9
Use --no-progress-meter instead of --silent so error reasons are printed
Signed-off-by: DL6ER <dl6er@dl6er.de>
2021-08-30 20:20:45 +02:00
DL6ER
21897d7fbd
Add warning if curl failed
Signed-off-by: DL6ER <dl6er@dl6er.de>
2021-08-30 15:55:42 +02:00
DL6ER
31c7c019cb
Fix piping to pihole tricorder
Signed-off-by: DL6ER <dl6er@dl6er.de>
2021-08-30 14:04:48 +02:00
Christian König
ffe45e8b76 On enabling/disabeling only reload-lists instead of reload
Signed-off-by: Christian König <ckoenig@posteo.de>
2021-08-06 20:51:48 +02:00
Christian König
6be647a85f Fix coloring of pihole -t
Signed-off-by: Christian König <ckoenig@posteo.de>
2021-07-16 21:52:12 +02:00
Adam Warner
4ac4bc5c18
Merge branch 'development' into fix/gravity_no_locallist 2021-07-04 00:48:09 +01:00
Christian König
4fb5157719 Squashed commits
Add simple grep function to pihole -t

Signed-off-by: Christian König <ckoenig@posteo.de>

Add help info

Signed-off-by: Christian König <ckoenig@posteo.de>

Improve help info

Signed-off-by: Christian König <ckoenig@posteo.de>

Fix details

Signed-off-by: Christian König <ckoenig@posteo.de>
2021-07-03 17:13:19 +02:00
DL6ER
aa88be335e
Acknowledge that IPV{4,6}_ADDRESS may not exist
Signed-off-by: DL6ER <dl6er@dl6er.de>
2021-04-16 11:44:54 +02:00
DL6ER
5df7ed2f32
Obtain FTL's PID from the PID file (#4103)
* Try to obtain FTL's PID from the PID file. If this fails, try to identify the main process using pgrep --oldest (instead of relying on pkill finding the right one by itself). This allows the script to work in even when FTL is running inside the memory checker valgrind.

* Rename FTL_PID -> FTL_PID_FILE

* Remove the pgrep fallback after discussions about that it should be more obvious to users if something strange happened to their PID file. Also, simplify the routine using a bashism in the end.

* Shorten if [[ regex ]]

* Use unset instead of emptying the PID variable

Signed-off-by: DL6ER <dl6er@dl6er.de>

Co-authored-by: Dan Schaper <dan.schaper@pi-hole.net>
2021-04-14 09:33:10 -07:00
Christian König
e7d937c412 Be more specific what pihole -d -a does
Signed-off-by: Christian König <ckoenig@posteo.de>
2020-11-15 20:31:47 +01:00
Adam Warner
bb1a6243d6
Merge pull request #3669 from pi-hole/release/v5.1.2
Release/v5.1.2 to development
2020-08-14 16:28:53 +01:00
Dan Schaper
548ad6375d
Merge pull request #3524 from pi-hole/fix/status_checking
Fix pihole status to not rely on a TCP port test
2020-07-28 07:24:34 -07:00
DL6ER
6ee6eea1fb
Use pkill instead of the somewhat fragile combination of kill + pidof. This solves some issues especially when there are many TCP workers floating around.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-07-21 21:13:40 +02:00
DL6ER
94cd7f59d4
Make verbose output the default.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-07-01 18:49:31 +02:00
DL6ER
6009e86947
Fix pihole status to not rely on a TCP port test. The current test can fail even when there is no error i case the max. number of TCP workers is reached.
Signed-off-by: DL6ER <dl6er@dl6er.de>
2020-07-01 18:39:28 +02:00
Thomas L. Kjeldsen
852f6b95f5 Prevent "pihole disable $timeout" from messing up future state changes
Signed-off-by: Thomas L. Kjeldsen <tlk@closureconsulting.com>
2020-05-30 02:58:27 +02:00
Dan Schaper
c76435883b
Merge pull request #3360 from dnicolson/fix-github-capitalisation
Fix GitHub capitalisation
2020-05-13 16:56:36 -07:00
Dave Nicolson
ab753e88a2 Fix GitHub capitalisation
Signed-off-by: Dave Nicolson <david.nicolson@gmail.com>
2020-05-13 12:55:00 +02:00
Adam Warner
9e96ff37de
Fix merge conflicts
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
2020-05-12 22:16:43 +01:00