From 4efb533d2eea6ea2b40729a6c4d59be411b1dc9e Mon Sep 17 00:00:00 2001 From: DL6ER Date: Mon, 1 Jan 2018 11:26:03 +0100 Subject: [PATCH] Create directories /etc/{var,log}/pihole on startup of pihole-FTL and set proper ownership Signed-off-by: DL6ER --- advanced/pihole-FTL.service | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/advanced/pihole-FTL.service b/advanced/pihole-FTL.service index b7def22c..959b7794 100644 --- a/advanced/pihole-FTL.service +++ b/advanced/pihole-FTL.service @@ -26,6 +26,10 @@ start() { echo "pihole-FTL is already running" else touch /var/log/pihole-FTL.log /run/pihole-FTL.pid /run/pihole-FTL.port /var/log/pihole.log + mkdir -p /var/run/pihole + mkdir -p /var/log/pihole + chown pihole:pihole /var/run/pihole /var/log/pihole + rm /var/run/pihole/FTL.sock chown pihole:pihole /var/log/pihole-FTL.log /run/pihole-FTL.pid /run/pihole-FTL.port /etc/pihole chmod 0644 /var/log/pihole-FTL.log /run/pihole-FTL.pid /run/pihole-FTL.port /var/log/pihole.log su -s /bin/sh -c "/usr/bin/pihole-FTL" "$FTLUSER"