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!

268 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. Thank you for your analysis.
    Looking forward to reading more of your posts.
    I hope to give something back and help others like you aided me

    Watch No Time to Die Online Free

    ReplyDelete
  3. 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
  4. 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
  5. 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
  6. Thanks for sharing such informative article. Check latest cooler buying guide on here

    ReplyDelete
  7. 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.

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

    ReplyDelete
  9. 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
  10. Hello world! It's a really great online shopping, I also purchased from this website but there services quality also awesome. So, here you can buy best 4K computer monitors, best ash vacuums, best car battery testers, best car seat Massagers, best airtight food storage containers, best air mattress pumps and best 12 cup coffee makers. And it's really helpful to buy from this online shopping.

    ReplyDelete
  11. 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

  12. 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
  13. https://www.yigitarabakirala.com
    Erzincanın Rentacar Merkezi
    Oto Kiralama Erzincan
    Erzincan Oto Kiralama
    Erzincan Rentacar

    ReplyDelete
  14. 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
  15. I am really overwhelmed with this article. I would like to thank for the efforts you have made in writing this post. Thanks for sharing. Great websites!! :)

    businessrooters

    ReplyDelete
  16. 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
    Digital marketing cannabis

    ReplyDelete
  17. 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..

    visit PokerClub88

    ReplyDelete
  18. 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
  19. 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
  20. Very good article! We will be linking to this particularly great content on our site. Keep up the good writing.Business Voice Pro

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

    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..

    visit PokerClub88

    ReplyDelete
  23. 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..

    visit PokerClub88

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

    ReplyDelete
  25. 메이저사이트 메이저놀이터 사설토토사이트 메이저추천을 먹튀검증하여 여러분께 가장 안전한 토토업체를 안내해드리고 있는 스포맨입니다

    ReplyDelete
  26. 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
  27. 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
  28. 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
  29. Secure your Website! Hide Your WordPress Website From Hackers ! Speed-up your Website!
    EASY TO USE. AFFORDABLE. FAST.

    You won’t have to worry about hackers anymore once you start using Hide My WordPress Ghost because this is the tool you have to use whenever you want to take the website security to the next level. This will offer you the much-needed security boost!

    Click Here To Buy Hide My WordPress GHOST

    ReplyDelete
  30. 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
    sean brown

    ReplyDelete
  31. 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
  32. 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
  33. unique . That’s what I need for my business! more>>> Bd help Bangla Tutorial


    unique . That’s what I need for my business! more>>> Marketing Pro Tech
    Economy Package
    Premium Package
    Sip Trunking
    Predictive Dialer
    Career

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

    ReplyDelete
  35. 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

    Ayan Deato

    ReplyDelete
  36. Nice post. I really enjoyed to read this post if you want read more click here utah seo services

    ReplyDelete
  37. 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
  38. 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
  39. I am very impressed for your Great information.Thanks a lot for sharing.

    ReplyDelete
  40. Nice post. I really enjoyed to read this post if you want read more click here keyword beauty school

    ReplyDelete
  41. Nice post. I really enjoyed to read this post if you want read more click here cbd oil

    ReplyDelete
  42. 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
  43. Good content and great article like the post buy pain pills and good weed online online will be back for some update

    Buy marijuana online

    Buy afghan-kush online

    Buy Xanax online

    ReplyDelete
  44. 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
  45. 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

    Celebrity trainer

    ReplyDelete
  46. 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

    Celebrity trainer

    ReplyDelete
  47. This article's 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..

    sean brown

    ReplyDelete
  48. 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
  49. unique . That’s what I need for my business! more>>> Business Voice Pro

    ReplyDelete
  50. 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
  51. 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
  52. hi, there is no doubt that you always shared good content and it is one of them. Keep doing your best.

    ReplyDelete
  53. This is a wonderful article, Given so much info in it Custom Name Patches

    ReplyDelete
  54. 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
  55. Newsone12.com will give you all about skin care tips in urdu/hindi.
    I will provide u skincare remedies that will give u instnat result without any side effects.
    At Newsone12.com i will upload an 100% natural remedies about skin care.
    Everyone like clear skin, flawlwss skin, spotless skin, crystal skin and fresh skin will help u to make your skin younger, glowing and beautiful skin by these natural and effective remdies, tips in urdu/hindi. Beauty Tips in urdu

    ReplyDelete
  56. Newsone12.com will give you all about skin care tips in urdu/hindi.
    I will provide u skincare remedies that will give u instnat result without any side effects.
    At Newsone12.com i will upload an 100% natural remedies about skin care.
    Everyone like clear skin, flawlwss skin, spotless skin, crystal skin and fresh skin will help u to make your skin younger, glowing and beautiful skin by these natural and effective remdies, tips in urdu/hindi. Beauty Tips in urdu

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

    ReplyDelete
  58. 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
  59. This blog is really interesting. please check my Blog site.
    We are sharing all celebrity biography and net worth, celebrity age.
    celebrity height, celebrity Instagram, celebrity boyfriends,
    celebrity wiki, celebrity bio, celebrity weight, Etc.

    celebrity biography

    Happy Blogging

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

    ATG

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

    ATG

    ReplyDelete

  62. 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
  63. 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
  64. very interesting information. let me share it with everyone to be useful. And don't forget to visit my blog at Iklan Gratis

    ReplyDelete
  65. Thanks to the author for sharing this awesome content with us.
    I have a small Nepali Jokes,Nepali News & Nepali Radio App please download and give your suggestion.

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

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

    ReplyDelete
  68. 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 motivational speaker

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

    ReplyDelete
  70. Nice article. Thanks for sharing.

    ReplyDelete
  71. 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
  72. 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 in the Africa

    ReplyDelete
  73. 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
  74. Thanks for sharing this kind of information with us. I am so happy to read your blog.It's so informative. Please share more and more in here with us.Thanks once again.

    A simple way to take your grappling game up to a whole new level with this Grappling dummy. Every hour you spend hitting the mats with one of these remarkably high-quality Grappling Dummies will bring epic improvement to your abilities against a real-life opponent. A great way to get time in the ring even when a human grappling partner isn’t available, this amazingly durable best bjj grappling dummy is designed to make it feel as close as possible to practicing moves with an actual competitor. An extraordinary tool for your mixed martial arts training regimen, whether you choose to spend time practicing your ground takedown tactics or a lifting or throwing move, and beyond.

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

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

    ReplyDelete
  77. Thank you for a really awesome blog. It was actually very helpful.
    Currency Market Live

    ReplyDelete
  78. 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
  79. 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
  80. I am a good user of this site so here I saw many articles and posts posted by this site,I am curious more hope you will give more information on this topics in your next articles group buy SEO tools

    ReplyDelete

  81. 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
  82. Nice article and explanation Keep continuing to write an article like this. This is a topic that’s near to my heart… Best wishes! I like your Post and helped me.

    No more waste time to searching #HDimages, #PCwallpaper, #smartphone_wallpaper, #socialmedia_banner, #socialmedia_image_post, #natureHDimages, and many more awesome pictures. Just visit All Awesome Pictures Only For Love Hearts and choose your best choice.
    All Awesome Pictures Only For Love Hearts
    All Awesome Pictures Only For Love Hearts
    All Awesome Pictures Only For Love Hearts

    ReplyDelete
  83. 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