mirror of
https://github.com/pi-hole/pi-hole
synced 2024-12-22 14:58:08 +00:00
Merge pull request #2315 from pi-hole/fix/regex-file-ownership
Allow PHP to edit the regex file if web is installed
This commit is contained in:
commit
833131e15f
@ -50,6 +50,7 @@ PI_HOLE_INSTALL_DIR="/opt/pihole"
|
||||
useUpdateVars=false
|
||||
|
||||
adlistFile="/etc/pihole/adlists.list"
|
||||
regexFile="/etc/pihole/regex.list"
|
||||
# Pi-hole needs an IP address; to begin, these variables are empty since we don't know what the IP is until
|
||||
# this script can run
|
||||
IPV4_ADDRESS=""
|
||||
@ -1235,6 +1236,12 @@ installConfigs() {
|
||||
# Make sure Pi-hole's config files are in place
|
||||
version_check_dnsmasq
|
||||
|
||||
# Install an empty regex file
|
||||
if [[ ! -f "${regexFile}" ]]; then
|
||||
# Let PHP edit the regex file, if installed
|
||||
install -o pihole -g "${LIGHTTPD_GROUP:-pihole}" -m 664 /dev/null "${regexFile}"
|
||||
fi
|
||||
|
||||
# If the user chose to install the dashboard,
|
||||
if [[ "${INSTALL_WEB_SERVER}" == true ]]; then
|
||||
# and if the Web server conf directory does not exist,
|
||||
|
@ -643,11 +643,6 @@ if [[ "${skipDownload}" == false ]] || [[ "${listType}" == "whitelist" ]]; then
|
||||
gravity_Whitelist
|
||||
fi
|
||||
|
||||
# Set proper permissions on the regex file
|
||||
touch "${regexFile}"
|
||||
chown pihole:www-data "${regexFile}"
|
||||
chmod 664 "${regexFile}"
|
||||
|
||||
convert_wildcard_to_regex
|
||||
gravity_ShowBlockCount
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user