diff --git a/.gitignore b/.gitignore index 2ccfc89..d4777d2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,28 @@ +# ---> macOS +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk -.DS_Store -.DS_Store -.DS_Store -.DS_Store -.DS_Store diff --git a/02-local-domains.conf b/02-local-domains.conf index 8aca71c..d3666e5 100644 --- a/02-local-domains.conf +++ b/02-local-domains.conf @@ -1,4 +1,8 @@ -server=/scity.us/172.18.0.10 -server=/schroedercity.com/172.18.0.10 -server=/misfitsmc.com/172.18.0.10 -server=/scity.xyz/172.18.0.10 +server=/scity.us/10.10.1.1 +server=/scity.us/10.10.10.11 +server=/schroedercity.com/10.10.1.1 +server=/schroedercity.com/10.10.10.11 +server=/misfitsmc.com/10.10.1.1 +server=/misfitsmc.com/10.10.10.11 +server=/scity.xyz/10.10.1.1 +server=/scity.xyz/10.10.10.11 diff --git a/pihole-sync b/pihole-sync index 3223516..1748c6a 100755 --- a/pihole-sync +++ b/pihole-sync @@ -34,6 +34,8 @@ update='December 26, 2020' # CONSTANTS if [ -f "/opt/my-pihole-sync/pihole-sync" ]; then personal_git_dir='/opt/my-pihole-sync' +elif [ -f "/etc/pihole/my-pihole-sync/pihole-sync" ]; then + personal_git_dir='/etc/pihole/my-pihole-sync' else personal_git_dir='/usr/local/bin/my-pihole-sync' fi @@ -105,9 +107,12 @@ pull_initialize () { # Overwrite local files cp $custom_list $pihole_dir cp $cname_list $dnsmasq_dir - # if [ ! -f "/opt/pihole-docker" ]; then - cp $localdomains_list $dnsmasq_dir - # fi + if [ $(/sbin/ip -o -4 addr list br0 | awk '{print $4}' | cut -d/ -f1) != "10.5.1.1" ] && [ $(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1) != "10.10.10.10" ]; then + # cp $localdomains_list $dnsmasq_dir + echo "copying" + else + echo "not copying" + fi # Overwrite local database tables @@ -165,28 +170,33 @@ pull () { # Update local Git repo from remote Git repo git remote update > /dev/null CHANGED=$(git log HEAD..origin/main --oneline) - if [ -n "${CHANGED}" ]; then + # if [ -n "${CHANGED}" ]; then echo 'Remote Git repo is different than local Pi-hole lists. Updating local lists...'; # Remove -q option if you don't want to run in "quiet" mode - git fetch --all -q - git reset --hard origin/main -q - $SUDO service pihole-FTL stop - cp $custom_list $pihole_dir - cp $cname_list $dnsmasq_dir - # if [ ! -f "/opt/pihole-docker" ]; then - cp $localdomains_list $dnsmasq_dir - # fi - sqlite3 $gravity_db "DROP TABLE adlist;" - sqlite3 $gravity_db -header -csv ".import adlist.csv adlist" - sqlite3 $gravity_db "DROP TABLE domainlist;" - sqlite3 $gravity_db -header -csv ".import domainlist.csv domainlist" - $SUDO pihole -g + # git fetch --all -q + # git reset --hard origin/main -q + # $SUDO service pihole-FTL stop + # cp $custom_list $pihole_dir + # cp $cname_list $dnsmasq_dir + if [[ $(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1) != *"10.10.10.11"* ]]; then + # cp $localdomains_list $dnsmasq_dir + echo "copying" + else + echo "not copying" + fi + echo $(/sbin/ip -o -4 addr list br0 | awk '{print $4}' | cut -d/ -f1) + echo $(/sbin/ip -o -4 addr list eth0 | awk '{print $4}' | cut -d/ -f1) + # sqlite3 $gravity_db "DROP TABLE adlist;" + # sqlite3 $gravity_db -header -csv ".import adlist.csv adlist" + # sqlite3 $gravity_db "DROP TABLE domainlist;" + # sqlite3 $gravity_db -header -csv ".import domainlist.csv domainlist" + # $SUDO pihole -g echo 'Done!'; exit 0 - else - echo 'Local Pi-hole lists match remote Git repo. No further action required.'; - exit 0 - fi + # else + # echo 'Local Pi-hole lists match remote Git repo. No further action required.'; + # exit 0 + # fi }