File pihole-script-cleanups.patch of Package pi-hole
Index: pi-hole-6.4.2/advanced/Scripts/list.sh
===================================================================
--- pi-hole-6.4.2.orig/advanced/Scripts/list.sh
+++ pi-hole-6.4.2/advanced/Scripts/list.sh
@@ -9,7 +9,7 @@
# This file is copyright under the latest version of the EUPL.
# Please see LICENSE file for your rights under this license.
-PI_HOLE_SCRIPT_DIR="/opt/pihole"
+PI_HOLE_SCRIPT_DIR="/usr/share/pihole"
utilsfile="${PI_HOLE_SCRIPT_DIR}/utils.sh"
# shellcheck source="./advanced/Scripts/utils.sh"
source "${utilsfile}"
@@ -39,7 +39,7 @@ domList=()
typeId=""
comment=""
-colfile="/opt/pihole/COL_TABLE"
+colfile="/usr/share/pihole/COL_TABLE"
# shellcheck source="./advanced/Scripts/COL_TABLE"
source ${colfile}
Index: pi-hole-6.4.2/advanced/Scripts/piholeDebug.sh
===================================================================
--- pi-hole-6.4.2.orig/advanced/Scripts/piholeDebug.sh
+++ pi-hole-6.4.2/advanced/Scripts/piholeDebug.sh
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/bin/bash
# Pi-hole: A black hole for Internet advertisements
# (c) 2017 Pi-hole, LLC (https://pi-hole.net)
# Network-wide ad blocking via your own hardware.
@@ -21,7 +21,7 @@ set -o pipefail
######## GLOBAL VARS ########
# These variables would normally be next to the other files
# but we need them to be first in order to get the colors needed for the script output
-PIHOLE_SCRIPTS_DIRECTORY="/opt/pihole"
+PIHOLE_SCRIPTS_DIRECTORY="/usr/share/pi-hole"
PIHOLE_COLTABLE_FILE="${PIHOLE_SCRIPTS_DIRECTORY}/COL_TABLE"
# These provide the colors we need for making the log more readable
@@ -69,8 +69,8 @@ CORE_GIT_DIRECTORY="/etc/.pihole"
CRON_D_DIRECTORY="/etc/cron.d"
DNSMASQ_D_DIRECTORY="/etc/dnsmasq.d"
PIHOLE_DIRECTORY="/etc/pihole"
-PIHOLE_SCRIPTS_DIRECTORY="/opt/pihole"
-BIN_DIRECTORY="/usr/local/bin"
+PIHOLE_SCRIPTS_DIRECTORY="/usr/share/pihole"
+BIN_DIRECTORY="/usr/bin"
LOG_DIRECTORY="/var/log/pihole"
HTML_DIRECTORY="$(get_ftl_conf_value "webserver.paths.webroot")"
WEBHOME_PATH="$(get_ftl_conf_value "webserver.paths.webhome")"
Index: pi-hole-6.4.2/advanced/Scripts/piholeLogFlush.sh
===================================================================
--- pi-hole-6.4.2.orig/advanced/Scripts/piholeLogFlush.sh
+++ pi-hole-6.4.2/advanced/Scripts/piholeLogFlush.sh
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/bin/bash
# Pi-hole: A black hole for Internet advertisements
# (c) 2017 Pi-hole, LLC (https://pi-hole.net)
# Network-wide ad blocking via your own hardware.
@@ -8,11 +8,11 @@
# This file is copyright under the latest version of the EUPL.
# Please see LICENSE file for your rights under this license.
-colfile="/opt/pihole/COL_TABLE"
+colfile="/usr/share/pihole/COL_TABLE"
# shellcheck source="./advanced/Scripts/COL_TABLE"
source ${colfile}
-readonly PI_HOLE_SCRIPT_DIR="/opt/pihole"
+readonly PI_HOLE_SCRIPT_DIR="/usr/share/pihole"
utilsfile="${PI_HOLE_SCRIPT_DIR}/utils.sh"
# shellcheck source="./advanced/Scripts/utils.sh"
source "${utilsfile}"
Index: pi-hole-6.4.2/advanced/Scripts/query.sh
===================================================================
--- pi-hole-6.4.2.orig/advanced/Scripts/query.sh
+++ pi-hole-6.4.2/advanced/Scripts/query.sh
@@ -10,13 +10,13 @@
# Please see LICENSE file for your rights under this license.
# Globals
-PI_HOLE_INSTALL_DIR="/opt/pihole"
+PI_HOLE_INSTALL_DIR="/usr/share/pihole"
max_results="20"
partial="false"
domain=""
# Source color table
-colfile="/opt/pihole/COL_TABLE"
+colfile="/usr/share/pihole/COL_TABLE"
# shellcheck source="./advanced/Scripts/COL_TABLE"
. "${colfile}"
Index: pi-hole-6.4.2/advanced/Scripts/version.sh
===================================================================
--- pi-hole-6.4.2.orig/advanced/Scripts/version.sh
+++ pi-hole-6.4.2/advanced/Scripts/version.sh
@@ -1,4 +1,4 @@
-#!/usr/bin/env sh
+#!/bin/sh
# Pi-hole: A black hole for Internet advertisements
# (c) 2017 Pi-hole, LLC (https://pi-hole.net)
# Network-wide ad blocking via your own hardware.
Index: pi-hole-6.4.2/gravity.sh
===================================================================
--- pi-hole-6.4.2.orig/gravity.sh
+++ pi-hole-6.4.2/gravity.sh
@@ -12,7 +12,7 @@
export LC_ALL=C
-PI_HOLE_SCRIPT_DIR="/opt/pihole"
+PI_HOLE_SCRIPT_DIR="/usr/share/pihole"
# Source utils.sh for GetFTLConfigValue
utilsfile="${PI_HOLE_SCRIPT_DIR}/utils.sh"
# shellcheck source=./advanced/Scripts/utils.sh
@@ -25,7 +25,7 @@ coltable="${PI_HOLE_SCRIPT_DIR}/COL_TABL
. "/etc/.pihole/advanced/Scripts/database_migration/gravity-db.sh"
basename="pihole"
-PIHOLE_COMMAND="/usr/local/bin/${basename}"
+PIHOLE_COMMAND="/usr/bin/${basename}"
piholeDir="/etc/${basename}"
Index: pi-hole-6.4.2/pihole
===================================================================
--- pi-hole-6.4.2.orig/pihole
+++ pi-hole-6.4.2/pihole
@@ -9,12 +9,12 @@
# This file is copyright under the latest version of the EUPL.
# Please see LICENSE file for your rights under this license.
-PI_HOLE_SCRIPT_DIR="/opt/pihole"
+PI_HOLE_SCRIPT_DIR="/usr/share/pihole"
# PI_HOLE_BIN_DIR is not readonly here because in some functions (checkout),
# they might get set again when the installer is sourced. This causes an
# error due to modifying a readonly variable.
-PI_HOLE_BIN_DIR="/usr/local/bin"
+PI_HOLE_BIN_DIR="/usr/bin"
# Hardcoded PID path — see GHSA-6w8x-p785-6pm4
readonly FTL_PID_FILE="/run/pihole-FTL.pid"