mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-22 06:03:43 +00:00
81927334f2
Inspired by: https://github.com/pi-hole/pi-hole/pull/2112 A pre-start and a post-stop script are added to reduce doubled setup and cleanup code. Since systemd services do not natively support dynamic users, test once whether capabilities are supported during install/update, and remove User=pihole otherwise. Signed-off-by: MichaIng <micha@dietpi.com> Co-authored-by: DL6ER <dl6er@dl6er.de>
13 lines
299 B
Bash
Executable file
13 lines
299 B
Bash
Executable file
#!/usr/bin/env sh
|
|
|
|
# Source utils.sh for getFTLPIDFile()
|
|
PI_HOLE_SCRIPT_DIR='/opt/pihole'
|
|
utilsfile="${PI_HOLE_SCRIPT_DIR}/utils.sh"
|
|
# shellcheck disable=SC1090
|
|
. "${utilsfile}"
|
|
|
|
# Get file paths
|
|
FTL_PID_FILE="$(getFTLPIDFile)"
|
|
|
|
# Cleanup
|
|
rm -f /run/pihole/FTL.sock /dev/shm/FTL-* "${FTL_PID_FILE}"
|