mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-06-06 18:04:54 +02:00
102 lines
3 KiB
Diff
102 lines
3 KiB
Diff
From 0c85af8e5388e50f613cb1900a27b99727cb8456 Mon Sep 17 00:00:00 2001
|
|
From: Mike Crute <mike@crute.us>
|
|
Date: Sat, 10 May 2025 15:40:34 -0700
|
|
Subject: [PATCH 1/3] Disallow some pihole commands for Linux distros
|
|
|
|
When Pi-hole is packaged as a Linux package several commands make
|
|
assumptions about the state of the system or the mutability of the
|
|
system that don't make sense and are managed by the distribution package
|
|
manager. Disable those commands to prevent corrupting the system.
|
|
---
|
|
pihole | 34 +++++++++++++++++++++++-----------
|
|
1 file changed, 23 insertions(+), 11 deletions(-)
|
|
|
|
diff --git a/pi-hole-6.0.6/pihole b/pi-hole-6.0.6/pihole
|
|
index bf662a82..1b5d0834 100755
|
|
--- a/pi-hole-6.0.6/pihole
|
|
+++ b/pi-hole-6.0.6/pihole
|
|
@@ -83,13 +83,21 @@ debugFunc() {
|
|
[[ "$value" == *"--check_database"* ]] && check_database_integrity="true"
|
|
done
|
|
|
|
- AUTOMATED=${automated:-} CHECK_DATABASE=${check_database_integrity:-} "${PI_HOLE_SCRIPT_DIR}"/piholeDebug.sh
|
|
- exit 0
|
|
+ if [ -n "${DOCKER_VERSION}" -o "${LINUX_DISTRO_PACKAGE}" ]; then
|
|
+ unsupportedFunc
|
|
+ else
|
|
+ AUTOMATED=${automated:-} CHECK_DATABASE=${check_database_integrity:-} "${PI_HOLE_SCRIPT_DIR}"/piholeDebug.sh
|
|
+ exit 0
|
|
+ fi
|
|
}
|
|
|
|
flushFunc() {
|
|
- "${PI_HOLE_SCRIPT_DIR}"/piholeLogFlush.sh "$@"
|
|
- exit 0
|
|
+ if [ -n "${DOCKER_VERSION}" -o "${LINUX_DISTRO_PACKAGE}" ]; then
|
|
+ unsupportedFunc
|
|
+ else
|
|
+ "${PI_HOLE_SCRIPT_DIR}"/piholeLogFlush.sh "$@"
|
|
+ exit 0
|
|
+ fi
|
|
}
|
|
|
|
arpFunc() {
|
|
@@ -98,7 +106,7 @@ arpFunc() {
|
|
}
|
|
|
|
updatePiholeFunc() {
|
|
- if [ -n "${DOCKER_VERSION}" ]; then
|
|
+ if [ -n "${DOCKER_VERSION}" -o "${LINUX_DISTRO_PACKAGE}" ]; then
|
|
unsupportedFunc
|
|
else
|
|
shift
|
|
@@ -108,7 +116,7 @@ updatePiholeFunc() {
|
|
}
|
|
|
|
repairPiholeFunc() {
|
|
- if [ -n "${DOCKER_VERSION}" ]; then
|
|
+ if [ -n "${DOCKER_VERSION}" -o "${LINUX_DISTRO_PACKAGE}" ]; then
|
|
unsupportedFunc
|
|
else
|
|
/etc/.pihole/automated\ install/basic-install.sh --repair
|
|
@@ -133,7 +141,7 @@ chronometerFunc() {
|
|
|
|
|
|
uninstallFunc() {
|
|
- if [ -n "${DOCKER_VERSION}" ]; then
|
|
+ if [ -n "${DOCKER_VERSION}" -o "${LINUX_DISTRO_PACKAGE}" ]; then
|
|
unsupportedFunc
|
|
else
|
|
"${PI_HOLE_SCRIPT_DIR}"/uninstall.sh
|
|
@@ -397,7 +405,7 @@ tailFunc() {
|
|
}
|
|
|
|
piholeCheckoutFunc() {
|
|
- if [ -n "${DOCKER_VERSION}" ]; then
|
|
+ if [ -n "${DOCKER_VERSION}" -o "${LINUX_DISTRO_PACKAGE}" ]; then
|
|
echo -e "${CROSS} Function not supported in Docker images"
|
|
echo "Please build a custom image following the steps at"
|
|
echo "https://github.com/pi-hole/docker-pi-hole?tab=readme-ov-file#building-the-image-locally"
|
|
@@ -451,12 +459,16 @@ tricorderFunc() {
|
|
}
|
|
|
|
updateCheckFunc() {
|
|
- "${PI_HOLE_SCRIPT_DIR}"/updatecheck.sh "$@"
|
|
- exit 0
|
|
+ if [ -n "${DOCKER_VERSION}" -o "${LINUX_DISTRO_PACKAGE}" ]; then
|
|
+ unsupportedFunc
|
|
+ else
|
|
+ "${PI_HOLE_SCRIPT_DIR}"/updatecheck.sh "$@"
|
|
+ exit 0
|
|
+ fi
|
|
}
|
|
|
|
unsupportedFunc(){
|
|
- echo "Function not supported in Docker images"
|
|
+ echo "Function not supported in this package format"
|
|
exit 0
|
|
}
|
|
|
|
--
|
|
2.45.2
|
|
|