mirror of
https://github.com/pi-hole/pi-hole
synced 2025-01-03 20:50:56 +00:00
Merge pull request #2317 from pi-hole/fix/parse_pihole-FTL.conf
Add empty pihole-FTL.conf file
This commit is contained in:
commit
a25a13fde0
@ -30,14 +30,14 @@
|
|||||||
#RESOLVE_IPV4=yes
|
#RESOLVE_IPV4=yes
|
||||||
|
|
||||||
## Max Database Days
|
## Max Database Days
|
||||||
## How long should queries be stored in the database [days]?
|
## How long should queries be stored in the database (days)?
|
||||||
## Setting this to 0 disables the database
|
## Setting this to 0 disables the database
|
||||||
## See: https://docs.pi-hole.net/ftldns/database/
|
## See: https://docs.pi-hole.net/ftldns/database/
|
||||||
## Options: number of days
|
## Options: number of days
|
||||||
#MAXDBDAYS=365
|
#MAXDBDAYS=365
|
||||||
|
|
||||||
## Database Interval
|
## Database Interval
|
||||||
## How often do we store queries in FTL's database [minutes]?
|
## How often do we store queries in FTL's database (minutes)?
|
||||||
## See: https://docs.pi-hole.net/ftldns/database/
|
## See: https://docs.pi-hole.net/ftldns/database/
|
||||||
## Options: number of minutes
|
## Options: number of minutes
|
||||||
#DBINTERVAL=1.0
|
#DBINTERVAL=1.0
|
||||||
@ -50,7 +50,7 @@
|
|||||||
#DBFILE=/etc/pihole/pihole-FTL.db
|
#DBFILE=/etc/pihole/pihole-FTL.db
|
||||||
|
|
||||||
## Max Log Age
|
## Max Log Age
|
||||||
## Up to how many hours of queries should be imported from the database and logs [hours]?
|
## Up to how many hours of queries should be imported from the database and logs (hours)?
|
||||||
## Maximum is 744 (31 days)
|
## Maximum is 744 (31 days)
|
||||||
## Options: number of days
|
## Options: number of days
|
||||||
#MAXLOGAGE=24.0
|
#MAXLOGAGE=24.0
|
||||||
|
@ -47,6 +47,7 @@ PI_HOLE_LOCAL_REPO="/etc/.pihole"
|
|||||||
PI_HOLE_FILES=(chronometer list piholeDebug piholeLogFlush setupLCD update version gravity uninstall webpage)
|
PI_HOLE_FILES=(chronometer list piholeDebug piholeLogFlush setupLCD update version gravity uninstall webpage)
|
||||||
# This folder is where the Pi-hole scripts will be installed
|
# This folder is where the Pi-hole scripts will be installed
|
||||||
PI_HOLE_INSTALL_DIR="/opt/pihole"
|
PI_HOLE_INSTALL_DIR="/opt/pihole"
|
||||||
|
PI_HOLE_CONFIG_DIR="/etc/pihole"
|
||||||
useUpdateVars=false
|
useUpdateVars=false
|
||||||
|
|
||||||
adlistFile="/etc/pihole/adlists.list"
|
adlistFile="/etc/pihole/adlists.list"
|
||||||
@ -1220,12 +1221,13 @@ installScripts() {
|
|||||||
install -o "${USER}" -Dm755 -t /usr/local/bin/ pihole
|
install -o "${USER}" -Dm755 -t /usr/local/bin/ pihole
|
||||||
install -Dm644 ./advanced/bash-completion/pihole /etc/bash_completion.d/pihole
|
install -Dm644 ./advanced/bash-completion/pihole /etc/bash_completion.d/pihole
|
||||||
echo -e "${OVER} ${TICK} ${str}"
|
echo -e "${OVER} ${TICK} ${str}"
|
||||||
|
|
||||||
# Otherwise,
|
# Otherwise,
|
||||||
else
|
else
|
||||||
# Show an error and exit
|
# Show an error and exit
|
||||||
echo -e "${OVER} ${CROSS} ${str}
|
echo -e "${OVER} ${CROSS} ${str}
|
||||||
${COL_LIGHT_RED}Error: Local repo ${PI_HOLE_LOCAL_REPO} not found, exiting installer${COL_NC}"
|
${COL_LIGHT_RED}Error: Local repo ${PI_HOLE_LOCAL_REPO} not found, exiting installer${COL_NC}"
|
||||||
exit 1
|
return 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1235,13 +1237,18 @@ installConfigs() {
|
|||||||
echo -e " ${INFO} Installing configs from ${PI_HOLE_LOCAL_REPO}..."
|
echo -e " ${INFO} Installing configs from ${PI_HOLE_LOCAL_REPO}..."
|
||||||
# Make sure Pi-hole's config files are in place
|
# Make sure Pi-hole's config files are in place
|
||||||
version_check_dnsmasq
|
version_check_dnsmasq
|
||||||
|
# Install empty file if it does not exist
|
||||||
|
if [[ ! -f "${PI_HOLE_CONFIG_DIR}/pihole-FTL.conf" ]]; then
|
||||||
|
if ! install -o pihole -g pihole -m 664 /dev/null "${PI_HOLE_CONFIG_DIR}/pihole-FTL.conf" &>/dev/nul; then
|
||||||
|
echo -e " ${COL_LIGHT_RED}Error: Unable to initialize configuration file ${PI_HOLE_CONFIG_DIR}/pihole-FTL.conf"
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
# Install an empty regex file
|
# Install an empty regex file
|
||||||
if [[ ! -f "${regexFile}" ]]; then
|
if [[ ! -f "${regexFile}" ]]; then
|
||||||
# Let PHP edit the regex file, if installed
|
# Let PHP edit the regex file, if installed
|
||||||
install -o pihole -g "${LIGHTTPD_GROUP:-pihole}" -m 664 /dev/null "${regexFile}"
|
install -o pihole -g "${LIGHTTPD_GROUP:-pihole}" -m 664 /dev/null "${regexFile}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# If the user chose to install the dashboard,
|
# If the user chose to install the dashboard,
|
||||||
if [[ "${INSTALL_WEB_SERVER}" == true ]]; then
|
if [[ "${INSTALL_WEB_SERVER}" == true ]]; then
|
||||||
# and if the Web server conf directory does not exist,
|
# and if the Web server conf directory does not exist,
|
||||||
@ -1777,9 +1784,15 @@ installPihole() {
|
|||||||
accountForRefactor
|
accountForRefactor
|
||||||
fi
|
fi
|
||||||
# Install base files and web interface
|
# Install base files and web interface
|
||||||
installScripts
|
if ! installScripts; then
|
||||||
|
echo -e " {CROSS} Failure in dependent script copy function."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
# Install config files
|
# Install config files
|
||||||
installConfigs
|
if ! installConfigs; then
|
||||||
|
echo -e " {CROSS} Failure in dependent config copy function."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
# If the user wants to install the dashboard,
|
# If the user wants to install the dashboard,
|
||||||
if [[ "${INSTALL_WEB_INTERFACE}" == true ]]; then
|
if [[ "${INSTALL_WEB_INTERFACE}" == true ]]; then
|
||||||
# do so
|
# do so
|
||||||
@ -2032,11 +2045,6 @@ FTLinstall() {
|
|||||||
# Always replace pihole-FTL.service
|
# Always replace pihole-FTL.service
|
||||||
install -T -m 0755 "${PI_HOLE_LOCAL_REPO}/advanced/Templates/pihole-FTL.service" "/etc/init.d/pihole-FTL"
|
install -T -m 0755 "${PI_HOLE_LOCAL_REPO}/advanced/Templates/pihole-FTL.service" "/etc/init.d/pihole-FTL"
|
||||||
|
|
||||||
# Install template if it does not exist
|
|
||||||
if [[ ! -f "/etc/pihole/pihole-FTL.conf" ]]; then
|
|
||||||
install -o "${USER}" -Dm644 "${PI_HOLE_LOCAL_REPO}/advanced/Templates/pihole-FTL.conf" "/etc/pihole/pihole-FTL.conf"
|
|
||||||
fi
|
|
||||||
|
|
||||||
local ftlBranch
|
local ftlBranch
|
||||||
local url
|
local url
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user