Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/pi-hole/pi-hole.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'advanced/Scripts/list.sh')
-rwxr-xr-xadvanced/Scripts/list.sh42
1 files changed, 21 insertions, 21 deletions
diff --git a/advanced/Scripts/list.sh b/advanced/Scripts/list.sh
index 5bd42d55..bc254515 100755
--- a/advanced/Scripts/list.sh
+++ b/advanced/Scripts/list.sh
@@ -16,7 +16,7 @@ GRAVITYDB="${piholeDir}/gravity.db"
# Source pihole-FTL from install script
pihole_FTL="${piholeDir}/pihole-FTL.conf"
if [[ -f "${pihole_FTL}" ]]; then
- source "${pihole_FTL}"
+ source "${pihole_FTL}"
fi
# Set this only after sourcing pihole-FTL.conf as the gravity database path may
@@ -133,7 +133,7 @@ ProcessDomainList() {
else
RemoveDomain "${dom}"
fi
- done
+ done
}
AddDomain() {
@@ -145,19 +145,19 @@ AddDomain() {
requestedListname="$(GetListnameFromTypeId "${typeId}")"
if [[ "${num}" -ne 0 ]]; then
- existingTypeId="$(sqlite3 "${gravityDBfile}" "SELECT type FROM domainlist WHERE domain = '${domain}';")"
- if [[ "${existingTypeId}" == "${typeId}" ]]; then
- if [[ "${verbose}" == true ]]; then
- echo -e " ${INFO} ${1} already exists in ${requestedListname}, no need to add!"
- fi
- else
- existingListname="$(GetListnameFromTypeId "${existingTypeId}")"
- sqlite3 "${gravityDBfile}" "UPDATE domainlist SET type = ${typeId} WHERE domain='${domain}';"
- if [[ "${verbose}" == true ]]; then
- echo -e " ${INFO} ${1} already exists in ${existingListname}, it has been moved to ${requestedListname}!"
+ existingTypeId="$(sqlite3 "${gravityDBfile}" "SELECT type FROM domainlist WHERE domain = '${domain}';")"
+ if [[ "${existingTypeId}" == "${typeId}" ]]; then
+ if [[ "${verbose}" == true ]]; then
+ echo -e " ${INFO} ${1} already exists in ${requestedListname}, no need to add!"
+ fi
+ else
+ existingListname="$(GetListnameFromTypeId "${existingTypeId}")"
+ sqlite3 "${gravityDBfile}" "UPDATE domainlist SET type = ${typeId} WHERE domain='${domain}';"
+ if [[ "${verbose}" == true ]]; then
+ echo -e " ${INFO} ${1} already exists in ${existingListname}, it has been moved to ${requestedListname}!"
+ fi
fi
- fi
- return
+ return
fi
# Domain not found in the table, add it!
@@ -185,10 +185,10 @@ RemoveDomain() {
requestedListname="$(GetListnameFromTypeId "${typeId}")"
if [[ "${num}" -eq 0 ]]; then
- if [[ "${verbose}" == true ]]; then
- echo -e " ${INFO} ${domain} does not exist in ${requestedListname}, no need to remove!"
- fi
- return
+ if [[ "${verbose}" == true ]]; then
+ echo -e " ${INFO} ${domain} does not exist in ${requestedListname}, no need to remove!"
+ fi
+ return
fi
# Domain found in the table, remove it!
@@ -256,8 +256,8 @@ NukeList() {
GetComment() {
comment="$1"
if [[ "${comment}" =~ [^a-zA-Z0-9_\#:/\.,\ -] ]]; then
- echo " ${CROSS} Found invalid characters in domain comment!"
- exit
+ echo " ${CROSS} Found invalid characters in domain comment!"
+ exit
fi
}
@@ -292,7 +292,7 @@ ProcessDomainList
# Used on web interface
if $web; then
-echo "DONE"
+ echo "DONE"
fi
if [[ ${reload} == true && ${noReloadRequested} == false ]]; then