mirror of
https://github.com/pi-hole/pi-hole
synced 2024-12-22 23:08:07 +00:00
Merge pull request #3248 from MichaIng/patch-8
Start pihole-FTL after network
This commit is contained in:
commit
b60ec8a48f
@ -13,7 +13,7 @@ LC_NUMERIC=C
|
|||||||
|
|
||||||
# Retrieve stats from FTL engine
|
# Retrieve stats from FTL engine
|
||||||
pihole-FTL() {
|
pihole-FTL() {
|
||||||
ftl_port=$(cat /var/run/pihole-FTL.port 2> /dev/null)
|
ftl_port=$(cat /run/pihole-FTL.port 2> /dev/null)
|
||||||
if [[ -n "$ftl_port" ]]; then
|
if [[ -n "$ftl_port" ]]; then
|
||||||
# Open connection to FTL
|
# Open connection to FTL
|
||||||
exec 3<>"/dev/tcp/127.0.0.1/$ftl_port"
|
exec 3<>"/dev/tcp/127.0.0.1/$ftl_port"
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
### BEGIN INIT INFO
|
### BEGIN INIT INFO
|
||||||
# Provides: pihole-FTL
|
# Provides: pihole-FTL
|
||||||
# Required-Start: $remote_fs $syslog
|
# Required-Start: $remote_fs $syslog $network
|
||||||
# Required-Stop: $remote_fs $syslog
|
# Required-Stop: $remote_fs $syslog $network
|
||||||
# Default-Start: 2 3 4 5
|
# Default-Start: 2 3 4 5
|
||||||
# Default-Stop: 0 1 6
|
# Default-Stop: 0 1 6
|
||||||
# Short-Description: pihole-FTL daemon
|
# Short-Description: pihole-FTL daemon
|
||||||
@ -10,7 +10,7 @@
|
|||||||
### END INIT INFO
|
### END INIT INFO
|
||||||
|
|
||||||
FTLUSER=pihole
|
FTLUSER=pihole
|
||||||
PIDFILE=/var/run/pihole-FTL.pid
|
PIDFILE=/run/pihole-FTL.pid
|
||||||
|
|
||||||
get_pid() {
|
get_pid() {
|
||||||
# First, try to obtain PID from PIDFILE
|
# First, try to obtain PID from PIDFILE
|
||||||
@ -37,12 +37,12 @@ start() {
|
|||||||
touch /var/log/pihole-FTL.log /var/log/pihole.log
|
touch /var/log/pihole-FTL.log /var/log/pihole.log
|
||||||
touch /run/pihole-FTL.pid /run/pihole-FTL.port
|
touch /run/pihole-FTL.pid /run/pihole-FTL.port
|
||||||
touch /etc/pihole/dhcp.leases
|
touch /etc/pihole/dhcp.leases
|
||||||
mkdir -p /var/run/pihole
|
mkdir -p /run/pihole
|
||||||
mkdir -p /var/log/pihole
|
mkdir -p /var/log/pihole
|
||||||
chown pihole:pihole /var/run/pihole /var/log/pihole
|
chown pihole:pihole /run/pihole /var/log/pihole
|
||||||
# Remove possible leftovers from previous pihole-FTL processes
|
# Remove possible leftovers from previous pihole-FTL processes
|
||||||
rm -f /dev/shm/FTL-* 2> /dev/null
|
rm -f /dev/shm/FTL-* 2> /dev/null
|
||||||
rm /var/run/pihole/FTL.sock 2> /dev/null
|
rm /run/pihole/FTL.sock 2> /dev/null
|
||||||
# Ensure that permissions are set so that pihole-FTL can edit all necessary files
|
# Ensure that permissions are set so that pihole-FTL can edit all necessary files
|
||||||
chown pihole:pihole /run/pihole-FTL.pid /run/pihole-FTL.port
|
chown pihole:pihole /run/pihole-FTL.pid /run/pihole-FTL.port
|
||||||
chown pihole:pihole /etc/pihole /etc/pihole/dhcp.leases 2> /dev/null
|
chown pihole:pihole /etc/pihole /etc/pihole/dhcp.leases 2> /dev/null
|
||||||
|
@ -30,7 +30,7 @@ server.document-root = "/var/www/html"
|
|||||||
server.error-handler-404 = "/pihole/index.php"
|
server.error-handler-404 = "/pihole/index.php"
|
||||||
server.upload-dirs = ( "/var/cache/lighttpd/uploads" )
|
server.upload-dirs = ( "/var/cache/lighttpd/uploads" )
|
||||||
server.errorlog = "/var/log/lighttpd/error.log"
|
server.errorlog = "/var/log/lighttpd/error.log"
|
||||||
server.pid-file = "/var/run/lighttpd.pid"
|
server.pid-file = "/run/lighttpd.pid"
|
||||||
server.username = "www-data"
|
server.username = "www-data"
|
||||||
server.groupname = "www-data"
|
server.groupname = "www-data"
|
||||||
server.port = 80
|
server.port = 80
|
||||||
|
@ -31,7 +31,7 @@ server.document-root = "/var/www/html"
|
|||||||
server.error-handler-404 = "/pihole/index.php"
|
server.error-handler-404 = "/pihole/index.php"
|
||||||
server.upload-dirs = ( "/var/cache/lighttpd/uploads" )
|
server.upload-dirs = ( "/var/cache/lighttpd/uploads" )
|
||||||
server.errorlog = "/var/log/lighttpd/error.log"
|
server.errorlog = "/var/log/lighttpd/error.log"
|
||||||
server.pid-file = "/var/run/lighttpd.pid"
|
server.pid-file = "/run/lighttpd.pid"
|
||||||
server.username = "lighttpd"
|
server.username = "lighttpd"
|
||||||
server.groupname = "lighttpd"
|
server.groupname = "lighttpd"
|
||||||
server.port = 80
|
server.port = 80
|
||||||
|
@ -1433,8 +1433,8 @@ installConfigs() {
|
|||||||
sed -i 's/^\(server\.error-handler-404\s*=\s*\).*$/\1"pihole\/custom\.php"/' /etc/lighttpd/lighttpd.conf
|
sed -i 's/^\(server\.error-handler-404\s*=\s*\).*$/\1"pihole\/custom\.php"/' /etc/lighttpd/lighttpd.conf
|
||||||
fi
|
fi
|
||||||
# Make the directories if they do not exist and set the owners
|
# Make the directories if they do not exist and set the owners
|
||||||
mkdir -p /var/run/lighttpd
|
mkdir -p /run/lighttpd
|
||||||
chown ${LIGHTTPD_USER}:${LIGHTTPD_GROUP} /var/run/lighttpd
|
chown ${LIGHTTPD_USER}:${LIGHTTPD_GROUP} /run/lighttpd
|
||||||
mkdir -p /var/cache/lighttpd/compress
|
mkdir -p /var/cache/lighttpd/compress
|
||||||
chown ${LIGHTTPD_USER}:${LIGHTTPD_GROUP} /var/cache/lighttpd/compress
|
chown ${LIGHTTPD_USER}:${LIGHTTPD_GROUP} /var/cache/lighttpd/compress
|
||||||
mkdir -p /var/cache/lighttpd/uploads
|
mkdir -p /var/cache/lighttpd/uploads
|
||||||
|
Loading…
Reference in New Issue
Block a user