pi-hole/advanced/Scripts
DL6ER 555dd4d8b3
Only accept a PID naming a running pihole-FTL
`/run/pihole-FTL.pid` is owned by the `pihole` user, but root reads it. `getFTLPID()` only rejected values starting with a non-digit, so `1+a[$(cmd)]` passed and was executed by the arithmetic `[[ ... -eq ... ]]` checks in `pihole`. The logrotate `postrotate` sent `kill -USR2` to whatever the file contained, including `-1`.

1. `getFTLPID()` accepts only a plain number whose `/proc/<pid>/comm` is `pihole-FTL`.
2. The logrotate `postrotate` uses `getFTLPID()`. The installer swaps this line in existing files, which are otherwise never replaced.

Signed-off-by: DL6ER <dl6er@dl6er.de>
2026-10-17 11:17:39 +02:00
..
database_migration Migrate existing databases to schema version 21 2026-09-19 16:17:03 +02:00
api.sh Revert "pihole api - use keepalive for curl queries" 2025-07-26 12:35:02 +01:00
COL_TABLE Set color codes when FORCE_COLOR is true 2025-06-24 19:03:24 +02:00
list.sh Remove readonly from list.sh to avoid errors 2025-07-14 21:20:39 -03:00
piholeCheckout.sh Prevent exiting due to set -e 2026-03-22 10:01:11 +01:00
piholeDebug.sh Use /etc/logrotate.d/pihole for logrotate file instead of /etc/pihole/logrotate 2026-05-13 08:38:31 +02:00
piholeLogFlush.sh Stop double-rotating logs now that pihole is in /etc/logrotate.d 2026-07-07 13:40:38 +01:00
piholeNetworkFlush.sh Remove readonly from piholeNetworkFlush.sh to avoid error message 2026-03-01 17:29:19 -03:00
query.sh Update advanced/Scripts/query.sh 2025-07-12 22:25:22 +00:00
update.sh update: abort if FTL branch does not exist 2025-07-10 21:37:28 +02:00
updatecheck.sh Apply suggestions from code review 2026-04-17 17:13:01 +02:00
utils.sh Only accept a PID naming a running pihole-FTL 2026-10-17 11:17:39 +02:00
version.sh Set versions in /etc/pihole/versions to null if script fails 2026-04-17 17:13:01 +02:00