From 217efbfb8bb06d34e2a68178e5ef2d4ee40c64ad Mon Sep 17 00:00:00 2001 From: Michael Stanclift Date: Tue, 26 May 2020 10:32:52 -0500 Subject: [PATCH] Validate gravity.db owner --- gravity-sync.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gravity-sync.sh b/gravity-sync.sh index 1159eb9..e004aa7 100755 --- a/gravity-sync.sh +++ b/gravity-sync.sh @@ -131,6 +131,16 @@ function pull_gs { sudo chown pihole:pihole ${PIHOLE_DIR}/${GRAVITY_FI} >/dev/null 2>&1 error_validate + MESSAGE="Validating Ownership on ${GRAVITY_FI}" + echo -en "${STAT} ${MESSAGE}" + GRAVDB_OWN=$(ls -ld ${PIHOLE_DIR}/${GRAVITY_FI} | awk '{print $3}') + if $GRAVDB_OWN = 'pihole' + then + echo -e "\r${GOOD} ${MESSAGE}" + else + echo -e "\r${FAIL} ${MESSAGE}" + fi + MESSAGE="Pausing One Second" echo -e "${INFO} ${MESSAGE}" sleep 1