mirror of
https://github.com/pi-hole/pi-hole.git
synced 2025-04-28 12:04:27 +02:00
Only show lines not containing sensitive keywords
Signed-off-by: Christian König <ckoenig@posteo.de>
This commit is contained in:
parent
77a30ac0c2
commit
d84da71310
1 changed files with 11 additions and 0 deletions
|
@ -587,11 +587,22 @@ processor_check() {
|
||||||
|
|
||||||
disk_usage() {
|
disk_usage() {
|
||||||
local file_system
|
local file_system
|
||||||
|
local hide
|
||||||
|
|
||||||
echo_current_diagnostic "Disk usage"
|
echo_current_diagnostic "Disk usage"
|
||||||
mapfile -t file_system < <(df -h)
|
mapfile -t file_system < <(df -h)
|
||||||
|
|
||||||
|
# Some lines of df might contain sensitive information like usernames and passwords.
|
||||||
|
# E.g. curlftpfs filesystems (https://www.looklinux.com/mount-ftp-share-on-linux-using-curlftps/)
|
||||||
|
# We are not interested in those lines so we collect keyword, to remove them from the output
|
||||||
|
# Additinal keywords can be added, separated by "|"
|
||||||
|
hide="curlftpfs"
|
||||||
|
|
||||||
|
# only show those lines not containg a sensitive phrase
|
||||||
for line in "${file_system[@]}"; do
|
for line in "${file_system[@]}"; do
|
||||||
|
if [[ ! $line =~ $hide ]]; then
|
||||||
log_write " ${line}"
|
log_write " ${line}"
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue