mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-12-23 21:30:17 +00:00
Add more comments
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
parent
788cd78321
commit
43bced7997
1 changed files with 7 additions and 4 deletions
|
@ -24,8 +24,8 @@ listType=""
|
|||
listname=""
|
||||
sqlitekey=""
|
||||
|
||||
# shellcheck source=/opt/pihole/COL_TABLE
|
||||
source "/opt/pihole/COL_TABLE"
|
||||
colfile="/opt/pihole/COL_TABLE"
|
||||
source ${colfile}
|
||||
|
||||
|
||||
helpFunc() {
|
||||
|
@ -63,7 +63,7 @@ EscapeRegexp() {
|
|||
# string in our regular expressions
|
||||
# This sed is intentionally executed in three steps to ease maintainability
|
||||
# The first sed removes any amount of leading dots
|
||||
echo "$@" | sed 's/^\.*//' | sed "s/[]\.|$(){}?+*^]/\\\\&/g" | sed "s/\\//\\\\\//g"
|
||||
echo $* | sed 's/^\.*//' | sed "s/[]\.|$(){}?+*^]/\\\\&/g" | sed "s/\\//\\\\\//g"
|
||||
}
|
||||
|
||||
HandleOther() {
|
||||
|
@ -190,8 +190,11 @@ Displaylist() {
|
|||
# pipe symbols as they are perfectly valid regex filter control characters
|
||||
num_pipes="$(grep -c "^" <<< "$(grep -o "|" <<< "${line}")")"
|
||||
|
||||
# Extract domain and enabled status based on the obtained number of pipe characters
|
||||
domain="$(cut -d'|' -f"-$((num_pipes-2))" <<< "${line}")"
|
||||
enabled="$(cut -d'|' -f$((num_pipes-1)) <<< "${line}")"
|
||||
enabled="$(cut -d'|' -f"$((num_pipes-1))" <<< "${line}")"
|
||||
|
||||
# Translate boolean status into human readable string
|
||||
if [[ "${enabled}" -eq 1 ]]; then
|
||||
status="enabled"
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue