mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 02:42:58 +00:00
Disable a few commands for Docker. Currently this is done by monkeypatching the the pihole
file on Docker install, however if someone was to run pihole checkout, these patches are removed.
Signed-off-by: Adam Warner <me@adamwarner.co.uk>
This commit is contained in:
parent
c86ff5d084
commit
b8eae60fcc
1 changed files with 27 additions and 7 deletions
20
pihole
20
pihole
|
@ -23,6 +23,9 @@ source "${colfile}"
|
||||||
utilsfile="${PI_HOLE_SCRIPT_DIR}/utils.sh"
|
utilsfile="${PI_HOLE_SCRIPT_DIR}/utils.sh"
|
||||||
source "${utilsfile}"
|
source "${utilsfile}"
|
||||||
|
|
||||||
|
versionsfile="/etc/pihole/versions"
|
||||||
|
source "${versionsfile}"
|
||||||
|
|
||||||
webpageFunc() {
|
webpageFunc() {
|
||||||
source "${PI_HOLE_SCRIPT_DIR}/webpage.sh"
|
source "${PI_HOLE_SCRIPT_DIR}/webpage.sh"
|
||||||
main "$@"
|
main "$@"
|
||||||
|
@ -63,14 +66,22 @@ arpFunc() {
|
||||||
}
|
}
|
||||||
|
|
||||||
updatePiholeFunc() {
|
updatePiholeFunc() {
|
||||||
|
if [ -n "${DOCKER_VERSION}" ]; then
|
||||||
|
unsupportedFunc
|
||||||
|
else
|
||||||
shift
|
shift
|
||||||
"${PI_HOLE_SCRIPT_DIR}"/update.sh "$@"
|
"${PI_HOLE_SCRIPT_DIR}"/update.sh "$@"
|
||||||
exit 0
|
exit 0
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
reconfigurePiholeFunc() {
|
reconfigurePiholeFunc() {
|
||||||
|
if [ -n "${DOCKER_VERSION}" ]; then
|
||||||
|
unsupportedFunc
|
||||||
|
else
|
||||||
/etc/.pihole/automated\ install/basic-install.sh --reconfigure
|
/etc/.pihole/automated\ install/basic-install.sh --reconfigure
|
||||||
exit 0;
|
exit 0;
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
updateGravityFunc() {
|
updateGravityFunc() {
|
||||||
|
@ -91,8 +102,12 @@ chronometerFunc() {
|
||||||
|
|
||||||
|
|
||||||
uninstallFunc() {
|
uninstallFunc() {
|
||||||
|
if [ -n "${DOCKER_VERSION}" ]; then
|
||||||
|
unsupportedFunc
|
||||||
|
else
|
||||||
"${PI_HOLE_SCRIPT_DIR}"/uninstall.sh
|
"${PI_HOLE_SCRIPT_DIR}"/uninstall.sh
|
||||||
exit 0
|
exit 0
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
versionFunc() {
|
versionFunc() {
|
||||||
|
@ -429,6 +444,11 @@ updateCheckFunc() {
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsupportedFunc(){
|
||||||
|
echo "Function not supported in Docker images"
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
helpFunc() {
|
helpFunc() {
|
||||||
echo "Usage: pihole [options]
|
echo "Usage: pihole [options]
|
||||||
Example: 'pihole -w -h'
|
Example: 'pihole -w -h'
|
||||||
|
|
Loading…
Reference in a new issue