{"action":"created","comment":{"url":"https://api.github.com/repos/pi-hole/pi-hole/pulls/comments/84402958","pull_request_review_id":5184426,"id":84402958,"diff_hunk":"@@ -96,6 +96,65 @@ versionFunc() {\n     exit 0\n }\n \n+restartDNS() {\n+  dnsmasqPid=$(pidof dnsmasq)\n+  if [[ ${dnsmasqPid} ]]; then\n+    # service already running - reload config\n+    if [ -x \"$(command -v systemctl)\" ]; then\n+      systemctl restart dnsmasq\n+    else\n+      service dnsmasq restart\n+    fi\n+  else\n+    # service not running, start it up\n+    if [ -x \"$(command -v systemctl)\" ]; then\n+      systemctl start dnsmasq\n+    else\n+      service dnsmasq start\n+    fi\n+  fi\n+}\n+\n+piholeEnable() {\n+  if [[ \"${1}\" == \"0\" ]] ; then\n+    #Disable Pihole\n+    sed -i 's/^addn-hosts/#addn-hosts/' /etc/dnsmasq.d/01-pihole.conf\n+  else\n+    #Enable pihole\n+    sed -i 's/^#addn-hosts/addn-hosts/' /etc/dnsmasq.d/01-pihole.conf\n+  fi\n+  restartDNS\n+}\n+\n+piholeStatus() {\n+  if [[ $(cat /etc/dnsmasq.d/01-pihole.conf | grep \"#addn-hosts=/\") ]] ; then\n+    #list is commented out\n+    if [[ \"${1}\" == \"web\" ]] ; then \n+      echo 0; \n+    else \n+      echo \":::  pihole is Disabled\";","path":"pihole","position":40,"original_position":40,"commit_id":"c83dd3ccd7dfafbd6e843b5a99df4b67de8549d7","original_commit_id":"c83dd3ccd7dfafbd6e843b5a99df4b67de8549d7","user":{"login":"Mcat12","id":4417660,"avatar_url":"https://avatars.githubusercontent.com/u/4417660?v=3","gravatar_id":"","url":"https://api.github.com/users/Mcat12","html_url":"https://github.com/Mcat12","followers_url":"https://api.github.com/users/Mcat12/followers","following_url":"https://api.github.com/users/Mcat12/following{/other_user}","gists_url":"https://api.github.com/users/Mcat12/gists{/gist_id}","starred_url":"https://api.github.com/users/Mcat12/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mcat12/subscriptions","organizations_url":"https://api.github.com/users/Mcat12/orgs","repos_url":"https://api.github.com/users/Mcat12/repos","events_url":"https://api.github.com/users/Mcat12/events{/privacy}","received_events_url":"https://api.github.com/users/Mcat12/received_events","type":"User","site_admin":false},"body":"pihole -> Pi-hole","created_at":"2016-10-21T00:45:17Z","updated_at":"2016-10-21T00:47:32Z","html_url":"https://github.com/pi-hole/pi-hole/pull/823#discussion_r84402958","pull_request_url":"https://api.github.com/repos/pi-hole/pi-hole/pulls/823","_links":{"self":{"href":"https://api.github.com/repos/pi-hole/pi-hole/pulls/comments/84402958"},"html":{"href":"https://github.com/pi-hole/pi-hole/pull/823#discussion_r84402958"},"pull_request":{"href":"https://api.github.com/repos/pi-hole/pi-hole/pulls/823"}}},"pull_request":{"url":"https://api.github.com/repos/pi-hole/pi-hole/pulls/823","id":90198586,"html_url":"https://github.com/pi-hole/pi-hole/pull/823","diff_url":"https://github.com/pi-hole/pi-hole/pull/823.diff","patch_url":"https://github.com/pi-hole/pi-hole/pull/823.patch","issue_url":"https://api.github.com/repos/pi-hole/pi-hole/issues/823","number":823,"state":"open","locked":false,"title":"Enable or disable","user":{"login":"tuplink","id":4369419,"avatar_url":"https://avatars.githubusercontent.com/u/4369419?v=3","gravatar_id":"","url":"https://api.github.com/users/tuplink","html_url":"https://github.com/tuplink","followers_url":"https://api.github.com/users/tuplink/followers","following_url":"https://api.github.com/users/tuplink/following{/other_user}","gists_url":"https://api.github.com/users/tuplink/gists{/gist_id}","starred_url":"https://api.github.com/users/tuplink/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tuplink/subscriptions","organizations_url":"https://api.github.com/users/tuplink/orgs","repos_url":"https://api.github.com/users/tuplink/repos","events_url":"https://api.github.com/users/tuplink/events{/privacy}","received_events_url":"https://api.github.com/users/tuplink/received_events","type":"User","site_admin":false},"body":"_This template was created based on the work of [`udemy-dl`](https://github.com/nishad/udemy-dl/blob/master/LICENSE)._\r\n\r\n**By submitting this pull request, I confirm the following (please check boxes, eg [X]):**\r\n\r\n- [x ] I have read and understood the [contributors guide](https://github.com/pi-hole/pi-hole/blob/master/CONTRIBUTING.md).\r\n- [x ] I have checked that [another pull request](https://github.com/pi-hole/pi-hole/pulls) for this purpose does not exist.\r\n- [ x] I have considered, and confirmed that this submission will be valuable to others.\r\n- [ x] I accept that this submission may not be used, and the pull request closed at the will of the maintainer.\r\n- [x ] I give this submission freely, and claim no ownership to its content.\r\n\r\n**How familiar are you with the codebase?:**\r\n\r\n- [x ] 5\r\n\r\n---\r\nadd enable/disable functionalty to pihole\r\nalso add a way to view status of thats functionalty (pihole status <web>)\r\n\r\nNotes:\r\n-in /var/www/html/admin/header.php file line 2 add\r\n if (isset($_GET['enable'])) {\r\n  exec('sudo pihole enable');\r\n  $refer = $_SERVER['HTTP_REFERER'];\r\n  header(\"location:$refer\");\r\n } elseif (isset($_GET['disable'])) {\r\n  exec('sudo pihole disable');\r\n  $refer = $_SERVER['HTTP_REFERER'];\r\n  header(\"location:$refer\");\r\n }\r\n\r\n-in /var/www/html/admin/header.php file line 141 change to $pistatus = exec('sudo pihole status web');\r\n-in /var/www/html/admin/header.php file line 143 change href to ?disable\r\n-in /var/www/html/admin/header.php file line 145 change href to ?enable\r\n\r\n","created_at":"2016-10-20T13:18:14Z","updated_at":"2016-10-21T00:47:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bb9bf070e3e65e52ab78d00d9e006fff28798d29","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/pi-hole/pi-hole/pulls/823/commits","review_comments_url":"https://api.github.com/repos/pi-hole/pi-hole/pulls/823/comments","review_comment_url":"https://api.github.com/repos/pi-hole/pi-hole/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pi-hole/pi-hole/issues/823/comments","statuses_url":"https://api.github.com/repos/pi-hole/pi-hole/statuses/c83dd3ccd7dfafbd6e843b5a99df4b67de8549d7","head":{"label":"tuplink:EnableOrDisable","ref":"EnableOrDisable","sha":"c83dd3ccd7dfafbd6e843b5a99df4b67de8549d7","user":{"login":"tuplink","id":4369419,"avatar_url":"https://avatars.githubusercontent.com/u/4369419?v=3","gravatar_id":"","url":"https://api.github.com/users/tuplink","html_url":"https://github.com/tuplink","followers_url":"https://api.github.com/users/tuplink/followers","following_url":"https://api.github.com/users/tuplink/following{/other_user}","gists_url":"https://api.github.com/users/tuplink/gists{/gist_id}","starred_url":"https://api.github.com/users/tuplink/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tuplink/subscriptions","organizations_url":"https://api.github.com/users/tuplink/orgs","repos_url":"https://api.github.com/users/tuplink/repos","events_url":"https://api.github.com/users/tuplink/events{/privacy}","received_events_url":"https://api.github.com/users/tuplink/received_events","type":"User","site_admin":false},"repo":{"id":71313694,"name":"pi-hole","full_name":"tuplink/pi-hole","owner":{"login":"tuplink","id":4369419,"avatar_url":"https://avatars.githubusercontent.com/u/4369419?v=3","gravatar_id":"","url":"https://api.github.com/users/tuplink","html_url":"https://github.com/tuplink","followers_url":"https://api.github.com/users/tuplink/followers","following_url":"https://api.github.com/users/tuplink/following{/other_user}","gists_url":"https://api.github.com/users/tuplink/gists{/gist_id}","starred_url":"https://api.github.com/users/tuplink/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tuplink/subscriptions","organizations_url":"https://api.github.com/users/tuplink/orgs","repos_url":"https://api.github.com/users/tuplink/repos","events_url":"https://api.github.com/users/tuplink/events{/privacy}","received_events_url":"https://api.github.com/users/tuplink/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tuplink/pi-hole","description":"A black hole for Internet advertisements (designed for Raspberry Pi)","fork":true,"url":"https://api.github.com/repos/tuplink/pi-hole","forks_url":"https://api.github.com/repos/tuplink/pi-hole/forks","keys_url":"https://api.github.com/repos/tuplink/pi-hole/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tuplink/pi-hole/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tuplink/pi-hole/teams","hooks_url":"https://api.github.com/repos/tuplink/pi-hole/hooks","issue_events_url":"https://api.github.com/repos/tuplink/pi-hole/issues/events{/number}","events_url":"https://api.github.com/repos/tuplink/pi-hole/events","assignees_url":"https://api.github.com/repos/tuplink/pi-hole/assignees{/user}","branches_url":"https://api.github.com/repos/tuplink/pi-hole/branches{/branch}","tags_url":"https://api.github.com/repos/tuplink/pi-hole/tags","blobs_url":"https://api.github.com/repos/tuplink/pi-hole/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tuplink/pi-hole/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tuplink/pi-hole/git/refs{/sha}","trees_url":"https://api.github.com/repos/tuplink/pi-hole/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tuplink/pi-hole/statuses/{sha}","languages_url":"https://api.github.com/repos/tuplink/pi-hole/languages","stargazers_url":"https://api.github.com/repos/tuplink/pi-hole/stargazers","contributors_url":"https://api.github.com/repos/tuplink/pi-hole/contributors","subscribers_url":"https://api.github.com/repos/tuplink/pi-hole/subscribers","subscription_url":"https://api.github.com/repos/tuplink/pi-hole/subscription","commits_url":"https://api.github.com/repos/tuplink/pi-hole/commits{/sha}","git_commits_url":"https://api.github.com/repos/tuplink/pi-hole/git/commits{/sha}","comments_url":"https://api.github.com/repos/tuplink/pi-hole/comments{/number}","issue_comment_url":"https://api.github.com/repos/tuplink/pi-hole/issues/comments{/number}","contents_url":"https://api.github.com/repos/tuplink/pi-hole/contents/{+path}","compare_url":"https://api.github.com/repos/tuplink/pi-hole/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tuplink/pi-hole/merges","archive_url":"https://api.github.com/repos/tuplink/pi-hole/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tuplink/pi-hole/downloads","issues_url":"https://api.github.com/repos/tuplink/pi-hole/issues{/number}","pulls_url":"https://api.github.com/repos/tuplink/pi-hole/pulls{/number}","milestones_url":"https://api.github.com/repos/tuplink/pi-hole/milestones{/number}","notifications_url":"https://api.github.com/repos/tuplink/pi-hole/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tuplink/pi-hole/labels{/name}","releases_url":"https://api.github.com/repos/tuplink/pi-hole/releases{/id}","deployments_url":"https://api.github.com/repos/tuplink/pi-hole/deployments","created_at":"2016-10-19T03:04:47Z","updated_at":"2016-10-19T03:04:48Z","pushed_at":"2016-10-20T22:45:36Z","git_url":"git://github.com/tuplink/pi-hole.git","ssh_url":"git@github.com:tuplink/pi-hole.git","clone_url":"https://github.com/tuplink/pi-hole.git","svn_url":"https://github.com/tuplink/pi-hole","homepage":"https://pi-hole.net","size":1345,"stargazers_count":0,"watchers_count":0,"language":"Shell","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"pi-hole:promoTweaksTheSecond","ref":"promoTweaksTheSecond","sha":"c71a976e7634e5c2cf7e5103c506c8c0513406a8","user":{"login":"pi-hole","id":16827203,"avatar_url":"https://avatars.githubusercontent.com/u/16827203?v=3","gravatar_id":"","url":"https://api.github.com/users/pi-hole","html_url":"https://github.com/pi-hole","followers_url":"https://api.github.com/users/pi-hole/followers","following_url":"https://api.github.com/users/pi-hole/following{/other_user}","gists_url":"https://api.github.com/users/pi-hole/gists{/gist_id}","starred_url":"https://api.github.com/users/pi-hole/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pi-hole/subscriptions","organizations_url":"https://api.github.com/users/pi-hole/orgs","repos_url":"https://api.github.com/users/pi-hole/repos","events_url":"https://api.github.com/users/pi-hole/events{/privacy}","received_events_url":"https://api.github.com/users/pi-hole/received_events","type":"Organization","site_admin":false},"repo":{"id":20619036,"name":"pi-hole","full_name":"pi-hole/pi-hole","owner":{"login":"pi-hole","id":16827203,"avatar_url":"https://avatars.githubusercontent.com/u/16827203?v=3","gravatar_id":"","url":"https://api.github.com/users/pi-hole","html_url":"https://github.com/pi-hole","followers_url":"https://api.github.com/users/pi-hole/followers","following_url":"https://api.github.com/users/pi-hole/following{/other_user}","gists_url":"https://api.github.com/users/pi-hole/gists{/gist_id}","starred_url":"https://api.github.com/users/pi-hole/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pi-hole/subscriptions","organizations_url":"https://api.github.com/users/pi-hole/orgs","repos_url":"https://api.github.com/users/pi-hole/repos","events_url":"https://api.github.com/users/pi-hole/events{/privacy}","received_events_url":"https://api.github.com/users/pi-hole/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pi-hole/pi-hole","description":"A black hole for Internet advertisements (designed for Raspberry Pi)","fork":false,"url":"https://api.github.com/repos/pi-hole/pi-hole","forks_url":"https://api.github.com/repos/pi-hole/pi-hole/forks","keys_url":"https://api.github.com/repos/pi-hole/pi-hole/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pi-hole/pi-hole/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pi-hole/pi-hole/teams","hooks_url":"https://api.github.com/repos/pi-hole/pi-hole/hooks","issue_events_url":"https://api.github.com/repos/pi-hole/pi-hole/issues/events{/number}","events_url":"https://api.github.com/repos/pi-hole/pi-hole/events","assignees_url":"https://api.github.com/repos/pi-hole/pi-hole/assignees{/user}","branches_url":"https://api.github.com/repos/pi-hole/pi-hole/branches{/branch}","tags_url":"https://api.github.com/repos/pi-hole/pi-hole/tags","blobs_url":"https://api.github.com/repos/pi-hole/pi-hole/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pi-hole/pi-hole/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pi-hole/pi-hole/git/refs{/sha}","trees_url":"https://api.github.com/repos/pi-hole/pi-hole/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pi-hole/pi-hole/statuses/{sha}","languages_url":"https://api.github.com/repos/pi-hole/pi-hole/languages","stargazers_url":"https://api.github.com/repos/pi-hole/pi-hole/stargazers","contributors_url":"https://api.github.com/repos/pi-hole/pi-hole/contributors","subscribers_url":"https://api.github.com/repos/pi-hole/pi-hole/subscribers","subscription_url":"https://api.github.com/repos/pi-hole/pi-hole/subscription","commits_url":"https://api.github.com/repos/pi-hole/pi-hole/commits{/sha}","git_commits_url":"https://api.github.com/repos/pi-hole/pi-hole/git/commits{/sha}","comments_url":"https://api.github.com/repos/pi-hole/pi-hole/comments{/number}","issue_comment_url":"https://api.github.com/repos/pi-hole/pi-hole/issues/comments{/number}","contents_url":"https://api.github.com/repos/pi-hole/pi-hole/contents/{+path}","compare_url":"https://api.github.com/repos/pi-hole/pi-hole/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pi-hole/pi-hole/merges","archive_url":"https://api.github.com/repos/pi-hole/pi-hole/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pi-hole/pi-hole/downloads","issues_url":"https://api.github.com/repos/pi-hole/pi-hole/issues{/number}","pulls_url":"https://api.github.com/repos/pi-hole/pi-hole/pulls{/number}","milestones_url":"https://api.github.com/repos/pi-hole/pi-hole/milestones{/number}","notifications_url":"https://api.github.com/repos/pi-hole/pi-hole/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pi-hole/pi-hole/labels{/name}","releases_url":"https://api.github.com/repos/pi-hole/pi-hole/releases{/id}","deployments_url":"https://api.github.com/repos/pi-hole/pi-hole/deployments","created_at":"2014-06-08T15:02:55Z","updated_at":"2016-10-20T23:02:50Z","pushed_at":"2016-10-20T22:45:37Z","git_url":"git://github.com/pi-hole/pi-hole.git","ssh_url":"git@github.com:pi-hole/pi-hole.git","clone_url":"https://github.com/pi-hole/pi-hole.git","svn_url":"https://github.com/pi-hole/pi-hole","homepage":"https://pi-hole.net","size":2417,"stargazers_count":1820,"watchers_count":1820,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":228,"mirror_url":null,"open_issues_count":112,"forks":228,"open_issues":112,"watchers":1820,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pi-hole/pi-hole/pulls/823"},"html":{"href":"https://github.com/pi-hole/pi-hole/pull/823"},"issue":{"href":"https://api.github.com/repos/pi-hole/pi-hole/issues/823"},"comments":{"href":"https://api.github.com/repos/pi-hole/pi-hole/issues/823/comments"},"review_comments":{"href":"https://api.github.com/repos/pi-hole/pi-hole/pulls/823/comments"},"review_comment":{"href":"https://api.github.com/repos/pi-hole/pi-hole/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pi-hole/pi-hole/pulls/823/commits"},"statuses":{"href":"https://api.github.com/repos/pi-hole/pi-hole/statuses/c83dd3ccd7dfafbd6e843b5a99df4b67de8549d7"}}}}
{"actor":{"display_login":"Mcat12"}}