From 0a1bba8c35b8df580e2644e7c8428f894c49f5db Mon Sep 17 00:00:00 2001 From: root Date: Sun, 29 Jan 2023 20:33:03 -0600 Subject: [PATCH] Updated January 29, 2023 8:33PM --- pihole-sync | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/pihole-sync b/pihole-sync index dca6e77..c12eadd 100755 --- a/pihole-sync +++ b/pihole-sync @@ -144,8 +144,8 @@ push () { git remote update > /dev/null # If local files are different than remote, update remote Git repo - #CHANGED=$(git --work-tree=$personal_git_dir status --porcelain) - #if [ -n "${CHANGED}" ]; then + CHANGED=$(git --work-tree=$personal_git_dir status --porcelain) + if [ -n "${CHANGED}" ]; then echo 'Local Pi-hole lists are different than remote Git repo. Updating remote repo...'; rightnow=$(date +"%B %e, %Y %l:%M%p") # Remove -q option if you don't want to run in "quiet" mode @@ -153,11 +153,11 @@ push () { git push -q echo 'Done!'; exit 0 - #else - # # If local files are the same as remote, do nothing and exit - # echo 'Remote Git repo matches local Pi-hole lists. No further action required.'; - # exit 0 - #fi + else + # If local files are the same as remote, do nothing and exit + echo 'Remote Git repo matches local Pi-hole lists. No further action required.'; + exit 0 + fi } pull () { # Go to Pi-hole directory, exit if doesn't exist @@ -189,6 +189,7 @@ pull () { fi } + ########################################################################### # Check to see whether a command line option was provided if [ -z "$1" ]