{"id":109,"date":"2023-08-06T18:19:32","date_gmt":"2023-08-06T18:19:32","guid":{"rendered":"https:\/\/hosting.foto-sjoet.nl\/?p=109"},"modified":"2023-08-13T08:04:56","modified_gmt":"2023-08-13T08:04:56","slug":"pi-hole-geeft-steed-meer-reclame-door-hoe-verhelp-ik-dit","status":"publish","type":"post","link":"https:\/\/hosting.foto-sjoet.nl\/?p=109","title":{"rendered":"PI Hole  database (gravity) updaten via script"},"content":{"rendered":"\n<p><\/p>\n\n\n\n<p>Als je met PI Hole de indruk hebt dat je steeds meer reclame te zien krijgt. dan is mogelijk de <em>gravity<\/em>&nbsp;database niet meer up-to-date, hier lees je hoe je dat doet doet.<br><\/p>\n\n\n\n<p>Ga via ssh naar de folder waar de PI Hole docker draait. <br>Via  &#8220;docker ps &#8211;format &#8216;{{.Names}}&#8217; &#8221; krijg je een een overzicht van alle containers, die ik zoek heeft piholelan  met het volgend commando update je de database:<\/p>\n\n\n\n<p>docker exec &lt;naam_vd_containter&gt; pihole updateGravity voor deze docker is het dus <\/p>\n\n\n\n<p>docker exec piholelan pihole updateGravity<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"755\" src=\"https:\/\/hosting.foto-sjoet.nl\/wp-content\/uploads\/2023\/08\/Screenshot-2023-08-06-at-20.19.27-1024x755.png\" alt=\"\" class=\"wp-image-111\" srcset=\"https:\/\/hosting.foto-sjoet.nl\/wp-content\/uploads\/2023\/08\/Screenshot-2023-08-06-at-20.19.27-1024x755.png 1024w, https:\/\/hosting.foto-sjoet.nl\/wp-content\/uploads\/2023\/08\/Screenshot-2023-08-06-at-20.19.27-300x221.png 300w, https:\/\/hosting.foto-sjoet.nl\/wp-content\/uploads\/2023\/08\/Screenshot-2023-08-06-at-20.19.27-768x566.png 768w, https:\/\/hosting.foto-sjoet.nl\/wp-content\/uploads\/2023\/08\/Screenshot-2023-08-06-at-20.19.27.png 1362w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Waarschijnlijk is je probleem opgelost, je kan weer reclamevrij surfen,maar dit wil je niet elke keer op deze manier doen toch ?  Dat kan makkelijker via een script dat regelmatig zelf wordt gestart ( dmv crontab) Eerst maken we een script in de home folder die bovenstaande uitvoert open nano of je favoriete editor met <\/p>\n\n\n\n<p>nano  pihole_lanupdate.sh <\/p>\n\n\n\n<p>cd \/<br>cd \/home\/hans\/docker\/pihole<br>docker exec piholelan&nbsp; pihole updateGravity<\/p>\n\n\n\n<p>Sla het script op via &lt;Crtl&gt;&lt;x&gt;  <br>Let er op dat het bestand het execute recht heeft <br>Dit kan je chekcken met  ls &lt;script_naam&gt; -l  in mijn geval  &#8220;ls pihole_lanupdate.sh&nbsp; -l&#8221; <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"868\" height=\"152\" src=\"https:\/\/hosting.foto-sjoet.nl\/wp-content\/uploads\/2023\/08\/Screenshot-2023-08-06-at-20.28.37.png\" alt=\"\" class=\"wp-image-114\" srcset=\"https:\/\/hosting.foto-sjoet.nl\/wp-content\/uploads\/2023\/08\/Screenshot-2023-08-06-at-20.28.37.png 868w, https:\/\/hosting.foto-sjoet.nl\/wp-content\/uploads\/2023\/08\/Screenshot-2023-08-06-at-20.28.37-300x53.png 300w, https:\/\/hosting.foto-sjoet.nl\/wp-content\/uploads\/2023\/08\/Screenshot-2023-08-06-at-20.28.37-768x134.png 768w\" sizes=\"auto, (max-width: 868px) 100vw, 868px\" \/><\/figure>\n\n\n\n<p>rwxr-xr-x de r = read , w=write, x=execute staat die x er nog niet dit los je op met chmod als sudo user via :<\/p>\n\n\n\n<p>sudo chmod +x .\/pihole_lanupdate.sh&nbsp;<br>Als je daarna weer &#8220;ls pihole_lanupdate.sh&nbsp; -l&#8221;  uitvoer zie je de output als hierboven.<br><\/p>\n\n\n\n<p>nu is het tijd om het script te testen die doe je via:<\/p>\n\n\n\n<p>bash .\/pihole_lanupdate.sh&nbsp;<br>Als het goed gegaan is, wordt de update nu via het script uitgevoerd, de laaste stap is die geautomatiseerd uit te voeren als schedule dit doe je met crontab. type <\/p>\n\n\n\n<p>sudo crontab -e <\/p>\n\n\n\n<p>en plaats helemaal onderaan de file dit <\/p>\n\n\n\n<p>0 1 * * 0 sudo \/home\/hand\/pihole_lanupdate.sh<\/p>\n\n\n\n<p>Dit houd in dat om 01:00 uur elke zondag het script wordt uitgevoerd, de volgende keer een blog met meer info over crontab.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Als je met PI Hole de indruk hebt dat je steeds meer reclame te zien krijgt. dan is mogelijk de gravity&nbsp;database niet meer up-to-date, hier<\/p>\n","protected":false},"author":1,"featured_media":117,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[20,18,19],"class_list":["post-109","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-raspberry","tag-bash","tag-crontab","tag-pihole-update"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>PI Hole database (gravity) updaten via script - Hosting | Raspberry | Home Assistant<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/hosting.foto-sjoet.nl\/?p=109\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"PI Hole database (gravity) updaten via script - Hosting | Raspberry | Home Assistant\" \/>\n<meta property=\"og:description\" content=\"Als je met PI Hole de indruk hebt dat je steeds meer reclame te zien krijgt. dan is mogelijk de gravity&nbsp;database niet meer up-to-date, hier\" \/>\n<meta property=\"og:url\" content=\"https:\/\/hosting.foto-sjoet.nl\/?p=109\" \/>\n<meta property=\"og:site_name\" content=\"Hosting | Raspberry | Home Assistant\" \/>\n<meta property=\"article:published_time\" content=\"2023-08-06T18:19:32+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-08-13T08:04:56+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/hosting.foto-sjoet.nl\/wp-content\/uploads\/2023\/08\/800px_COLOURBOX34924474.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"800\" \/>\n\t<meta property=\"og:image:height\" content=\"586\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Hans\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Hans\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/hosting.foto-sjoet.nl\/?p=109#article\",\"isPartOf\":{\"@id\":\"https:\/\/hosting.foto-sjoet.nl\/?p=109\"},\"author\":{\"name\":\"Hans\",\"@id\":\"https:\/\/hosting.foto-sjoet.nl\/#\/schema\/person\/b834986d86029b34bdba968d9dea06eb\"},\"headline\":\"PI Hole database (gravity) updaten via script\",\"datePublished\":\"2023-08-06T18:19:32+00:00\",\"dateModified\":\"2023-08-13T08:04:56+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/hosting.foto-sjoet.nl\/?p=109\"},\"wordCount\":343,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/hosting.foto-sjoet.nl\/#\/schema\/person\/b834986d86029b34bdba968d9dea06eb\"},\"image\":{\"@id\":\"https:\/\/hosting.foto-sjoet.nl\/?p=109#primaryimage\"},\"thumbnailUrl\":\"https:\/\/hosting.foto-sjoet.nl\/wp-content\/uploads\/2023\/08\/800px_COLOURBOX34924474.jpg\",\"keywords\":[\"Bash\",\"Crontab\",\"PIhole update\"],\"articleSection\":[\"Raspberry\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/hosting.foto-sjoet.nl\/?p=109#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/hosting.foto-sjoet.nl\/?p=109\",\"url\":\"https:\/\/hosting.foto-sjoet.nl\/?p=109\",\"name\":\"PI Hole database (gravity) updaten via script - Hosting | Raspberry | Home Assistant\",\"isPartOf\":{\"@id\":\"https:\/\/hosting.foto-sjoet.nl\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/hosting.foto-sjoet.nl\/?p=109#primaryimage\"},\"image\":{\"@id\":\"https:\/\/hosting.foto-sjoet.nl\/?p=109#primaryimage\"},\"thumbnailUrl\":\"https:\/\/hosting.foto-sjoet.nl\/wp-content\/uploads\/2023\/08\/800px_COLOURBOX34924474.jpg\",\"datePublished\":\"2023-08-06T18:19:32+00:00\",\"dateModified\":\"2023-08-13T08:04:56+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/hosting.foto-sjoet.nl\/?p=109#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/hosting.foto-sjoet.nl\/?p=109\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/hosting.foto-sjoet.nl\/?p=109#primaryimage\",\"url\":\"https:\/\/hosting.foto-sjoet.nl\/wp-content\/uploads\/2023\/08\/800px_COLOURBOX34924474.jpg\",\"contentUrl\":\"https:\/\/hosting.foto-sjoet.nl\/wp-content\/uploads\/2023\/08\/800px_COLOURBOX34924474.jpg\",\"width\":800,\"height\":586},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/hosting.foto-sjoet.nl\/?p=109#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/hosting.foto-sjoet.nl\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"PI Hole database (gravity) updaten via script\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/hosting.foto-sjoet.nl\/#website\",\"url\":\"https:\/\/hosting.foto-sjoet.nl\/\",\"name\":\"Hosting | Raspberry | Home Assistant\",\"description\":\"Backup | installatie hulp |\",\"publisher\":{\"@id\":\"https:\/\/hosting.foto-sjoet.nl\/#\/schema\/person\/b834986d86029b34bdba968d9dea06eb\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/hosting.foto-sjoet.nl\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/hosting.foto-sjoet.nl\/#\/schema\/person\/b834986d86029b34bdba968d9dea06eb\",\"name\":\"Hans\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/hosting.foto-sjoet.nl\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/dfad6d4508122ec2e3204d3a7249ee191d3a677250ca9d691d6b7b57cc9f5e5f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/dfad6d4508122ec2e3204d3a7249ee191d3a677250ca9d691d6b7b57cc9f5e5f?s=96&d=mm&r=g\",\"caption\":\"Hans\"},\"logo\":{\"@id\":\"https:\/\/hosting.foto-sjoet.nl\/#\/schema\/person\/image\/\"},\"sameAs\":[\"https:\/\/hosting.foto-sjoet.nl\"],\"url\":\"https:\/\/hosting.foto-sjoet.nl\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"PI Hole database (gravity) updaten via script - Hosting | Raspberry | Home Assistant","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/hosting.foto-sjoet.nl\/?p=109","og_locale":"en_US","og_type":"article","og_title":"PI Hole database (gravity) updaten via script - Hosting | Raspberry | Home Assistant","og_description":"Als je met PI Hole de indruk hebt dat je steeds meer reclame te zien krijgt. dan is mogelijk de gravity&nbsp;database niet meer up-to-date, hier","og_url":"https:\/\/hosting.foto-sjoet.nl\/?p=109","og_site_name":"Hosting | Raspberry | Home Assistant","article_published_time":"2023-08-06T18:19:32+00:00","article_modified_time":"2023-08-13T08:04:56+00:00","og_image":[{"width":800,"height":586,"url":"https:\/\/hosting.foto-sjoet.nl\/wp-content\/uploads\/2023\/08\/800px_COLOURBOX34924474.jpg","type":"image\/jpeg"}],"author":"Hans","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Hans","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/hosting.foto-sjoet.nl\/?p=109#article","isPartOf":{"@id":"https:\/\/hosting.foto-sjoet.nl\/?p=109"},"author":{"name":"Hans","@id":"https:\/\/hosting.foto-sjoet.nl\/#\/schema\/person\/b834986d86029b34bdba968d9dea06eb"},"headline":"PI Hole database (gravity) updaten via script","datePublished":"2023-08-06T18:19:32+00:00","dateModified":"2023-08-13T08:04:56+00:00","mainEntityOfPage":{"@id":"https:\/\/hosting.foto-sjoet.nl\/?p=109"},"wordCount":343,"commentCount":0,"publisher":{"@id":"https:\/\/hosting.foto-sjoet.nl\/#\/schema\/person\/b834986d86029b34bdba968d9dea06eb"},"image":{"@id":"https:\/\/hosting.foto-sjoet.nl\/?p=109#primaryimage"},"thumbnailUrl":"https:\/\/hosting.foto-sjoet.nl\/wp-content\/uploads\/2023\/08\/800px_COLOURBOX34924474.jpg","keywords":["Bash","Crontab","PIhole update"],"articleSection":["Raspberry"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/hosting.foto-sjoet.nl\/?p=109#respond"]}]},{"@type":"WebPage","@id":"https:\/\/hosting.foto-sjoet.nl\/?p=109","url":"https:\/\/hosting.foto-sjoet.nl\/?p=109","name":"PI Hole database (gravity) updaten via script - Hosting | Raspberry | Home Assistant","isPartOf":{"@id":"https:\/\/hosting.foto-sjoet.nl\/#website"},"primaryImageOfPage":{"@id":"https:\/\/hosting.foto-sjoet.nl\/?p=109#primaryimage"},"image":{"@id":"https:\/\/hosting.foto-sjoet.nl\/?p=109#primaryimage"},"thumbnailUrl":"https:\/\/hosting.foto-sjoet.nl\/wp-content\/uploads\/2023\/08\/800px_COLOURBOX34924474.jpg","datePublished":"2023-08-06T18:19:32+00:00","dateModified":"2023-08-13T08:04:56+00:00","breadcrumb":{"@id":"https:\/\/hosting.foto-sjoet.nl\/?p=109#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/hosting.foto-sjoet.nl\/?p=109"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/hosting.foto-sjoet.nl\/?p=109#primaryimage","url":"https:\/\/hosting.foto-sjoet.nl\/wp-content\/uploads\/2023\/08\/800px_COLOURBOX34924474.jpg","contentUrl":"https:\/\/hosting.foto-sjoet.nl\/wp-content\/uploads\/2023\/08\/800px_COLOURBOX34924474.jpg","width":800,"height":586},{"@type":"BreadcrumbList","@id":"https:\/\/hosting.foto-sjoet.nl\/?p=109#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/hosting.foto-sjoet.nl\/"},{"@type":"ListItem","position":2,"name":"PI Hole database (gravity) updaten via script"}]},{"@type":"WebSite","@id":"https:\/\/hosting.foto-sjoet.nl\/#website","url":"https:\/\/hosting.foto-sjoet.nl\/","name":"Hosting | Raspberry | Home Assistant","description":"Backup | installatie hulp |","publisher":{"@id":"https:\/\/hosting.foto-sjoet.nl\/#\/schema\/person\/b834986d86029b34bdba968d9dea06eb"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/hosting.foto-sjoet.nl\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/hosting.foto-sjoet.nl\/#\/schema\/person\/b834986d86029b34bdba968d9dea06eb","name":"Hans","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/hosting.foto-sjoet.nl\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/dfad6d4508122ec2e3204d3a7249ee191d3a677250ca9d691d6b7b57cc9f5e5f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/dfad6d4508122ec2e3204d3a7249ee191d3a677250ca9d691d6b7b57cc9f5e5f?s=96&d=mm&r=g","caption":"Hans"},"logo":{"@id":"https:\/\/hosting.foto-sjoet.nl\/#\/schema\/person\/image\/"},"sameAs":["https:\/\/hosting.foto-sjoet.nl"],"url":"https:\/\/hosting.foto-sjoet.nl\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/hosting.foto-sjoet.nl\/index.php?rest_route=\/wp\/v2\/posts\/109","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hosting.foto-sjoet.nl\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hosting.foto-sjoet.nl\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hosting.foto-sjoet.nl\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hosting.foto-sjoet.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=109"}],"version-history":[{"count":9,"href":"https:\/\/hosting.foto-sjoet.nl\/index.php?rest_route=\/wp\/v2\/posts\/109\/revisions"}],"predecessor-version":[{"id":221,"href":"https:\/\/hosting.foto-sjoet.nl\/index.php?rest_route=\/wp\/v2\/posts\/109\/revisions\/221"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hosting.foto-sjoet.nl\/index.php?rest_route=\/wp\/v2\/media\/117"}],"wp:attachment":[{"href":"https:\/\/hosting.foto-sjoet.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=109"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hosting.foto-sjoet.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=109"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hosting.foto-sjoet.nl\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=109"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}