Friday, February 28, 2020

Update: maintaining the pi-hole HA pair

In an earlier post, I shared how I got pi-hole working in my environment, thanks to a number of posts on a reddit thread. Since then, I've been living with the setup and tweaking my configuration a bit.

This post documents one of the tweaks that might be useful for others...

If you're using the method documented by Panja0, you know that there's a script in the pi-hole distribution (gravity.sh) that must be edited in order to synchronize files between the nodes of the HA pair. Well, he reminds you in the tutorial that it'll need to be re-edited every time you update pi-hole, or the synchronization won't occur.

As you might guess, I didn't remember when I updated a week ago, and couldn't understand why my settings weren't getting synchronized. So I went back to the post, reviewed my settings, and face-palmed myself when I discovered my oversight. I had failed to re-edit gravity.sh

After I did the necessary edits, I realized that, even if I'd remembered about it, I'd still need to refer to the original post to get the right command line, etc., for the edits.

I didn't want to spend the time to figure out how to trigger a script to make the update for me upon a pi-hole update, but I sure could figure out the script to do the correct updates!

I mean... come on: what better use of automation than to use a script to a) check to see if the update has already been performed, and b) if not, perform the update?

#!/bin/bash
# make sure the pihole-gemini script is being run by gravity.sh

GEMINI='su -c /usr/local/bin/pihole-gemini - <gemini user>'
GRAVITY=/opt/pihole/gravity.sh

TRIGGER=$(sed -e '$!{h;d;}' -e x $GRAVITY)
if [ "$TRIGGER" != "$GEMINI" ]
then
        # insert the gemini commandline before the last line of the script
        sed -i "$ i$GEMINI" $GRAVITY
fi

If you decide to use the script, just make sure that you make any necessary modifications for the first two script variables to match your installation. You also need it on both nodes of your HA pair!

In my setup, I'm saving this script in the /etc/scripts directory, which I'm using for other "keepalived" scripts. I'll remember to run it next time I update pi-hole, and that's all I'll need to recall!

184 comments:

  1. Thank you for sharing, and nice articles you have here buy fakenotes online moreover the admin of this site has really worked hard for all this once more thanks for sharing your articles.

    ReplyDelete
  2. Rumah pods merupakan sebuah toko yang menyediakan berbagai keperluan terkait rokok elektrik jenis pod vape. Anda dapat menemukan berbagai jenis pods seperti JUUL, NCIG, Druga Lyfe, hingga Zeal serta kelengkapan lainnya dalam satu tempat, yaitu RUMAHPODS.

    Apa itu Pod System?
    Sensasi yang didapatkan saat menghisap rokok biasa dan pods hampir sama. Hanya saja, pods dirancang lebih cerdas dan ringkas dengan meminimalisir pembakaran. Pods sebagai rokok elektrik terhindar dari 7.000 senyawa kimia yang dapat memicu kanker serta penyakit paru-paru lainnya.


    ReplyDelete
  3. I didn't want to spendbuy-tripadvisor-reviews the time to figure out how to trigger a script to make the update for me upon a pi-hole update, but I sure could figure out the script to do the correct updates!

    ReplyDelete
  4. Alizeh Shah Scandal Biography Age Dramas Pictures Family Alizeh Shah is a Pakistani on-screen character who began her profession in 2018 with the show Ishq Tamasha. Alizeh Shah was immediately seen by the watchers and makers the same due to her attractive features as well as in view of her ability.
    Read More

    ReplyDelete
  5. Thanks for sharing such informative article. Check latest cooler buying guide on here

    ReplyDelete
  6. PharmEnvee – CoronaCide Kills the Coronavirus On Contact One single application of

    CoronaCideTM on

    surfaces will show germ-killing amount of chlorine up to 28days. The product can be

    applied with proper equipment and traditional material. Once treated, the surfaces are

    safe to touch with no known risks of toxicity. The active ingredients are safe and are not

    known to cause irritation or sensitization.

    ReplyDelete
  7. The product can N95 Mask be applied with proper equipment and traditional material. Once treated, the surfaces are safe to touch with no known risks of toxicity. The active ingredients are safe and are not known to cause irritation or sensitization.

    ReplyDelete

  8. This article content is really unique and amazing.This article really helpful and explained very well.So i am really thankful to you for sharing keep it up..

    เกมบาคาร่าออนไลน์

    ReplyDelete
  9. Much obliged to you again for all the learning you distribute,Good post. I was exceptionally intrigued by the article, it's entirely rousing I ought to concede. I like going by you site since I generally run over fascinating articles like this one.Great Job, I enormously acknowledge that.Do Keep sharing! Respects, thetrever

    ReplyDelete
  10. Best Article top sex medicine awesome post. I really appreciate this website. Mainly this website great for sex medicine and it's really helpful for better sex even also great loves makes you more comfortable and confident. So I really prefer you to buy this pills from the website.

    ReplyDelete
  11. Very good article! We will be linking to this particularly great content on our site. Keep up the good writing.Business Voice Pro

    ReplyDelete
  12. You rock and please keep up the successful work. the tre ver

    ReplyDelete
  13. Don't compromise on quality. essayplanet homework helpers can service all your academic needs perfectly.
    academic helper

    ReplyDelete
  14. I am a Freelance Graphic Design Expert. Do Logo, Banner, Businesscard, FB cover.. You can learn more http://www.freelancegraphicdesignexpert.com.I have read the article. Short but in depth. Nice information. I like the article and it's an useful article. Thanks for such and article.
    Mainur Rashid

    ReplyDelete
  15. Thanks a lot for sharing .
    Did you know ? Pomsky is a designer breed of dog that is a hybrid of the Pomeranian and the Siberian Husky. Adorable Pomsky puppies have attracted a lot of attention recently and made them one of the most popular breeds of 2017.
    Best Online Pet Adoption : Cavapoo Puppies For Sale : Australian Shepherd Puppies Below $200 : Available Maltipoo Puppies Online : Where To Buy Golden Retriever Puppies Online

    ReplyDelete
  16. Hi
    Usually I never comment on blogs but your article is so convincing that I never stop myself to say something about it. I am Really very happy to say that this post is very interesting and informative to read.

    Thanks

    ReplyDelete
  17. This is packwoods official website and it's genuinely awesome. I really appreciate this website. Mainly this website great for online shopping and it's also have fastest packwoods delivery services even also you can get packwoods wedding cake, packwoods mango haze, packwoods strawnana and more. So I really prefer you to online shopping on this website because it's safe, secure and fastest delivery.

    ReplyDelete
  18. This comment has been removed by the author.

    ReplyDelete
  19. This comment has been removed by the author.

    ReplyDelete
  20. Thanks for sharing this. Check out my Mommy Blog and Work From Home Guides too!

    ReplyDelete
  21. This article content is really unique and amazing.This article really helpful and explained very well.So i am really thankful to you for sharing keep it up..
    Hanna Kozlowska

    ReplyDelete
  22. This article content is really unique and amazing.This article really helpful and explained very well.So i am really thankful to you for sharing keep it up..
    lucas asher
    lucas asher
    lucas asher
    lucas asher
    lucas asher

    ReplyDelete
  23. I am very impressed for your Great information.Thanks a lot for sharing.

    ReplyDelete
  24. Your own one of a kind duty to getting the message all through came to be fairly incredible
    choosemychoicefast
    theincrediblethoughtstwo
    easylifestyleforyou
    gowitheasylife
    insectstheory
    travelerdesi
    ccommonlifestyle

    and have reliably empowered representatives simply like me to show up at their ideal objectives.

    ReplyDelete
  25. This article content is really unique and amazing.This article really helpful and explained very well.So i am really thankful to you for sharing keep it up..

    lucas asher

    ReplyDelete
  26. Vision blinds are offering a double layer fabric with translucent and blackout or light filtering color with an eye-catching stylish model which is best suited for the modern accomplished home keeping privacy on and at the same time outside view from inside by Australian Window Covering service.

    vision blinds

    ReplyDelete
  27. This comment has been removed by the author.

    ReplyDelete
  28. Thank you so much for the information that you have shared here with all of us. You have made it easier for us...

    Top online trainer

    ReplyDelete
  29. I’m looking for a diamond jewellery for my wife. Read this post its very informative. Keep it up buddy.I’m not too picky on price but I will want to see about getting a custom ring as I want it to be unique for my wife.

    ReplyDelete
  30. hi, there is no doubt that you always shared good content and it is one of them. Keep doing your best.

    ReplyDelete
  31. such amazing content really learned a lot. also do check my website :worldfree4u
    Thank you.

    ReplyDelete
  32. Nature will take care of itself eventually. It's great to see the regrowth coming along nicely. Looks quite strange at the moment, half burnt/half growth. Visit BEVYBUZZ!

    ReplyDelete

  33. With over 10 years of experience in the relocation industry, founder, Mosart Santos has developed the art and science of professional office relocation in London. Our company took off after Mosart met and partnered with Carlos in 2010. Today, We serve a wide array of offices while continually building our reputation as an industry leader with a passionate and experienced team working towards achieving one unique goal.

    Our robust relationship with our clients over the years implies that we: deliver peace of mind, work earnestly to satisfy our customers, and ensure excellent customer service on a regular basis. We love London and take pride in being one of its most trusted and reliable office relocation companies.
    url: office relocation specialists

    ReplyDelete
  34. Nice article and explanation Keep continuing to write an article like this you may also check my website Allywebsite.com We established Allywebsite in order to Create Long-Term Relationships with Our Community & Inspire Happiness and Positivity we been around since 2015 helping our people get more knowledge in building website so welcome aboard the ship

    Regards:
    Carlos

    Allywebsite.com

    ReplyDelete
  35. very interesting information. let me share it with everyone to be useful. And don't forget to visit my blog at Iklan Gratis

    ReplyDelete
  36. Very well written article. Thanks for sharing this information.
    Visit here

    ReplyDelete
  37. This website has a lot of good information. Very well written. It is useful for many people

    ReplyDelete
  38. روش کاشت مو SUT در مقایسه با تکنیک های دیگر از قبیل FIT و FUT روش جدیدتر و موفق تری است که تمامی مراحل آن، از برداشت تا کاشت فولیکول‌ های مو، توسط دستگاه های اتوماتیک صورت می‌گیرد. از آنجایی که در کاشت مو SUT تمامی مراحل توسط دستگاه انجام می گیرد، میزان تخریب ریشه مو، درد و خونریزی کم است.

    ReplyDelete
  39. Nice article. Thanks for sharing.

    ReplyDelete
  40. Usually I never comment on blogs but your article is so convincing that I never stop myself
    to say something about it. i am Really very happy to say that this post is very interesting
    to read.

    You’re doing a great job Man, Keep it up.
    I blog at
    Best motivational speaker

    ReplyDelete
  41. This article content is really unique and amazing.This article really helpful and explained very well.So i am really thankful to you for sharing keep it up..

    Best weed marketing

    ReplyDelete
  42. This comment has been removed by the author.

    ReplyDelete
  43. Thanks for sharing a very nice blog post amazing.
    Best Gaming Grave Reviews

    ReplyDelete
  44. This comment has been removed by the author.

    ReplyDelete
  45. Hey, Its Amazing Blog Post And I Found This Very Useful. Thanks For sharing With Us. And Of course Keep Posting Bro. My Response

    ReplyDelete
  46. zzzoomer The next time I read a blog, I hope that it won't disappoint me as much as this particular one. I mean, Yes, it was my choice to read through, however I truly thought you'd have something helpful to say. All I hear is a bunch of whining about something you can fix if you weren't too busy searching for attention.

    ReplyDelete

  47. Thank you for sharing, and nice articles you have here buy weed online moreover the admin of this site has really worked hard for all this once more thanks for sharing your articles.
    https://420kushdispensary.com/
    https://420kushdispensary.com/how-to-pay/
    https://420kushdispensary.com/flowers/
    https://420kushdispensary.com/dank-woodsprerolls/
    https://420kushdispensary.com/codeine/
    https://420kushdispensary.com/bongs/
    https://420kushdispensary.com/vape-catridges/
    https://420kushdispensary.com/cbd-oils/

    ReplyDelete
  48. Thank you so much for the information that you have shared here with all of us.worldfree4u

    Software company in India

    India

    free seo tools

    ooltah

    ReplyDelete
  49. Nice post. I learn something totally new and challenging on websites I stumbleupon on a daily basis. It will always be helpful to read through articles from other writers and use a little something from other websites. viablequran.com

    ReplyDelete
  50. I was more than happy to discover this website. I want to to thank you for ones time for this particularly wonderful read!! I definitely loved every little bit of it and i also have you saved to fav to check out new stuff on your website.learn quran online

    ReplyDelete
  51. Wow Amazing Exlanation. Keep it up,
    Thanks For Sharing such a Usefull Article.
    movie4me.in
    9xmve.in/

    ReplyDelete
  52. The next time I read a blog, I hope that it does not disappoint me as much as this one. I mean, Yes, it was my choice to read, Canon EOS M100 but I really thought you would probably have something interesting to talk about. All I hear is a bunch of whining about something that you can fix if you weren't too busy searching for attention.

    ReplyDelete
  53. I blog frequently and I really appreciate your content. This article has really peaked my interest. I will book mark your website and keep checking for new details about once per week. I subscribed to your Feed as well.viablequran.com

    ReplyDelete
  54. We have a great collection for science, brain, equations, pi, hole. We have the best and exclusive t-shirt, crop top, and much more. Suitable for all purposes.You can find all the items at Scopic

    ReplyDelete
  55. Thank you so much. This article was very essential for me . I after a long time I found this kind of article.

    ReplyDelete
  56. Good article. I like reading such posts. Thanks for sharing.
    WordPress Design Agency

    ReplyDelete
  57. " Chairs Accent | High quality chairs buying guides and Reviews
    Chairs Accent A place to get honest and unbiased review on chairs from dedicated experts, visit our site and make an informed purchase of your new chair.
    "

    ReplyDelete
  58. Thanks for right unique information about this topic Desi Deals.

    ReplyDelete
  59. It is very nice and informative post. I enjoyed every little bit of it. Thanks for sharing with us.

    All mattress topper review guide

    ReplyDelete
  60. Thanks for sharing this information.

    Best Regards
    Andi Rumah Kontainer

    ReplyDelete
  61. maintaining the pi-hole HA pair such great tips very help full for us amazing stylish and unique thanks for upload.

    ReplyDelete
  62. Thanks for sharing about maintaining the pi-hole HA pair.

    ReplyDelete
  63. Very useful post. This is my first time i visit here. I found so many interesting stuff in your blog especially its discussion. Really its great article. Keep it up. mobile price in bd

    ReplyDelete
  64. This article content is really unique and amazing.This article really helpful and explained very well.So i am really thankful to you for sharing keep it up.Clik Here For More Information...mobile price in bd

    ReplyDelete
  65. Love your post.
    https://crackvip.com/winzip-pro-crack/

    ReplyDelete
  66. An interesting discussion is definitely worth comment. I do believe that you should publish more on this subject matter, it may not be a taboo subject but usually people don't speak about such subjects. To the next! Cheers!!
    english-course

    ReplyDelete
  67. POLITICAL BLACKLASH

    TWITTER NAZI
    WHY DID JACK DORSEY KILL FREE SPEECH
    WRITTEN:BY RAY RAY 11/23/2020
    rwbilling67@gmail.com


    Why did Jack Dorsey work, day and night to censor his most Important account..President Trumps. It's inconceivable that the President Of America would face a smear campaign on Twitter. But why would Jack Dorsey allow this? Had he not learned form his previous mistakes? This Is where I began to question "What's In It for Dorsey? Click Here To READ MORE

    ReplyDelete
  68. WoW Great article. I like your site very much. Keep up up the great work.
    THANKS

    ReplyDelete
  69. To make use of my interpersonal skills to achieve goals of a company
    that focuses on customer satisfaction and customer experience.A highly organized and hard-working
    individual looking for a responsible position to gain practical experience.Clik Hare..
    https://www.facebook.com/profile.php?id=100006323506895

    ReplyDelete
  70. Nice and engeaging content keep doing the great work man.<>Checkout My website also: My websiteLove from India



    ReplyDelete


  71. Nice and engeaging content keep doing the great work man.<>Checkout My website also: My websiteLove from India



    ReplyDelete
  72. Thanks for right nice information about this best topic Such an Awesome Blog !! Keep up the Good Work !! all details about it really interesting. gk guru

    ReplyDelete
  73. A place to do good business. I bought few different things from 2A Warehouse. Great quality kits are coming out of this place. The pricing is reasonable and shipping fast. Had a great overall experience dealing with these guys. If you guys have purchased any products from 2A Warehouse, you can share your reviews on this thread. Click here to read our review rules and guidelines in detail.
    2a Warehouse Reviews
    https://ar15-forum.com/threads/2a-warehouse-reviews.167/

    ReplyDelete
  74. I will be honest these is the most useful tips I have read till date. Thanks for putting all this together. As a newbie blogger, I am going through different stages of learning and all ups and downs that a normal newbie blogger face. But the most important thing I am not giving up and holding it until I find success. I am really positive using your thoughts and knowledge will help me to improve myself. siberian husky puppies for rehoming      Great work. Keep doing this great work for us. Loved it.

    ReplyDelete
  75.  anyone need gellan gum e418? both high acyl and low acyl content, pure and non-GMO,10 year's professional factory in China.high acyl gellan gum,low acyl gellan gum,gellan gum supplier

    ReplyDelete
  76. thank you for sharing this incredible site.aussiedoodle-puppies-for-sale-near-me.thank you so much.

    ReplyDelete
  77. This website was... how do you say it? Relevant!! I finally found something that helped me. You can read online info about Turkey evisa requirements.The Turkey e visa is an electronic visa that allows entry into Turkey.

    ReplyDelete
  78. I know this is quality based blogs along with other stuff
    Mobile Prices Bangladesh

    ReplyDelete
  79. Buy Vape & Accessories, Coils, Pods, Tank, E-Juice Online at Low Price From Vape shop in jubail. Available COD All City of Al Khobar, Al Jubail, Al Hasa.

    ReplyDelete
  80. This is great post, very informative. I’m wondering why the other experts of this sector don’t understand this. You must continue your writing. I am confident, you’ve a great readers base already! Hope you will provide more information to us, we also provide Best SEO Expert in Bangladesh & Digital Marketing Service including all tasks like: SEO, SEM, PPC, SMO, SMM, E-mail marketing, Webdesign and development Youngest Entrepreneur in Bangladesh. good for all

    ReplyDelete
  81. Recommendations for cafes or cafe places to relax with colleagues and work relatives must be accompanied by a comfortable place and have a wide capacity. The best cafe in Siantar is really qualified for you workers or students as well as mothers and fathers and the elderly must try and feel the feel of this place.

    Cafe Terbaik di Siantar

    ReplyDelete
  82. This post gives truly quality information. hope to see you again. I find that this post is really amazing.

    Algorithmic Trading

    ReplyDelete
  83. nice for sharing tps & tricks you can also visit my webiste ipal komunal

    ReplyDelete
  84. This article very interesting for me and very good information.. please visit to my blog too

    Idnplay88
    Idnplay88
    Idnplay88
    Idnplay88
    Idnplay88
    Idnplay88
    Idnplay88
    Idnplay88
    slot jutawan
    playsbobet

    ReplyDelete
  85. Nice. Thanks for this post . Amazing article.
    Premium Account Generator Minecraft

    ReplyDelete
  86. VPNExpo! Our channel provides the latest news, reviews, and tips about VPNs to keep you safe online. VPNs are more important than ever due to increasing online threats and privacy concerns. Whether you're new to VPNs or an experienced user, our channel has all the information you need to navigate this complex world. Join us today and explore the world of VPNs with VPNExpo!
    More Information Please visit
    https://www.youtube.com/@VPNExpo

    ReplyDelete
  87. Slot Gacor Very interesting info !Perfect just what I was searching for!,

    ReplyDelete
  88. The information provided above was very informative and usefull Click here for amazing gadgets

    ReplyDelete
  89. Very interesting, I would like to understand the second part better but for the moment very useful, thanks case vacanze maldive del salento

    ReplyDelete
  90. Great job on your pi-hole setup! Your documentation of the tweak is super helpful. Forgetting to re-edit gravity.sh after updates is a common hiccup, but your automated solution is brilliant. Thanks for sharing the script and its usage. Looking forward to more insights from your pi-hole journey! 🚀

    ReplyDelete