From 679aab10d0400d55470a5d53215158490736068a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Mon, 9 Oct 2023 21:52:43 +0200 Subject: [PATCH] Run gravity as user pihole MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- automated install/basic-install.sh | 4 ++-- gravity.sh | 7 ------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index ef2c8d52..ae605fcf 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -1385,8 +1385,8 @@ installCron() { # Gravity is a very important script as it aggregates all of the domains into a single HOSTS formatted list, # which is what Pi-hole needs to begin blocking ads runGravity() { - # Run gravity in the current shell - { /opt/pihole/gravity.sh --force; } + # Run gravity in the current shell as user pihole + { exec sudo -u pihole bash /opt/pihole/gravity.sh --force; } } # Check if the pihole user exists and create if it does not diff --git a/gravity.sh b/gravity.sh index 4f87c1d7..9133d33d 100755 --- a/gravity.sh +++ b/gravity.sh @@ -488,10 +488,6 @@ compareLists() { # We assume here it was changed upstream database_adlist_status "${adlistID}" "1" fi - - # set owner of the file to pihole - chown pihole:pihole "${target}.sha1" - } # Download specified URL and perform checks on HTTP status and file content @@ -625,9 +621,6 @@ gravity_DownloadBlocklistFromUrl() { database_adlist_status "${adlistID}" "4" fi fi - - # set owner of the file to pihole - chown pihole:pihole "${saveLocation}" } # Parse source files into domains format