* 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>
* 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>
* 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>
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>
* 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>