{"action":"created","comment":{"url":"https://api.github.com/repos/TheJumpCloud/Extensions/pulls/comments/55425668","id":55425668,"diff_hunk":"@@ -0,0 +1,300 @@\n+#!/bin/bash\n+\n+###############################################################################\n+#\n+# ldap_check.sh - Reads in LDAP Binding User Service Account, organization ID\n+#       and service account password to aid in troubleshooting ldap\n+#       connectivity problems.\n+#\n+# Questions or issues with the operation of the script, please contact\n+# support@jumpcloud.com\n+#\n+# Author: Rob Holden | rholden@jumpcloud.com\n+# \n+###############################################################################\n+\n+clear\n+\n+#\n+# Help screen\n+#\n+\n+help() {\n+\n+echo \"###################################################################\"\n+echo \"#                                                                 #\"\n+echo \"#          LDAP setup and troubleshooting utility                 #\"\n+echo \"#                                                                 #\"\n+echo \"###################################################################\"\n+echo \"\"\n+echo \"Enter q to exit\"\n+echo \"\"\n+echo \"This utility is meant to assist in testing and configuring LDAP\t\"\n+echo \"with JumpCloud using the native ldapsearch command.            \t\"\n+echo \"\"\n+echo \"Step 1. Enter account variables\t\t\t\t\t\"\n+echo \"\tLDAP Binding User account name:  If you do not know this, please\"\n+echo \"\trefer to http://support.jumpcloud.com/knowledgebase/articles/474\"\n+echo \"\t035-configuring-your-application-with-jumpcloud-ldap\t\t\"\n+echo \"\"\n+echo \"\tPassword:  This is the password for the LDAP Binding User\t\"\n+echo \"\"\n+echo \"\tOrganization ID: if you do not know this, please refer to http:/\"\n+echo \"\t/support.jumpcloud.com/knowledgebase/articles/413926-jumpcloud-s-\"\n+echo \"\thosted-ldap-service\t\t\t\t\t\t\"\n+echo \"\"\n+echo \"Step 2. Pick a port using option 2 or 3\t\t\t\t\"\n+echo \"\"\n+echo \"Step 3. Option 4 will allow you to connect to LDAP and search  \t\"\n+echo \"using the defined account variables\t\t\t\t\"\n+echo \"\"\n+echo \"Option 5 will list common strings used by the applications\t\"\n+echo \"that will athenticate to JumpCloud LDAP.\t\t\t\t\"\n+echo \"\"\n+echo \"Option 9 displays this help screen\t\t\t\t\"\n+echo \"\"\n+echo \"Option 0 will exit the utility\t\t\t\t\t\"\n+}\n+\n+\n+#\n+# ldapsearch\n+#\n+\n+# Check for ldapsearch command\n+\n+ldapsearch=`which ldapsearch`\n+\n+which ldapsearch &>/dev/null;\n+\n+if [ $? != 0 ]\n+\tthen\n+\t\techo \"ldapsearch is not in your path or not installed.  Please correct and rerun this script\";\n+\t\texit 1;\n+fi\n+\n+\n+# Check account vars have been entered\n+\n+check_ldap_config() {\n+\n+if [ -z \"$port\" ]\n+        then\n+                echo \"Port Undefined, using default 636\";\n+                port=636;\n+                read -rsp $'press key to continue \\n' -n1 key\n+fi\n+\n+if [ \"$port\" = \"389 -ZZ\" ]\n+        then\n+                uri=ldap\n+        else\n+                uri=ldaps\n+fi\n+\n+if [ -z \"$user\" ]\n+        then\n+                echo -e \"\\nAccount variables undefined, enter information and reselect\\n\";\n+                read_account;\n+fi\n+}\n+\n+# Define ldapsearch \n+\n+ldsearch() {\n+\n+check_ldap_config\n+\n+$ldapsearch -H ${uri}://ldap.jumpcloud.com:${port} -x -b \"ou=Users,o=${oid},dc=jumpcloud,dc=com\" -D \"uid=${user},ou=Users,o=${oid},dc=jumpcloud,dc=com\" -w \"${pass}\" \"(objectClass=${search_param})\" | less\n+\n+}\n+\n+#\n+# Display common configuration strings\n+#\n+\n+echo_ldap_config() {\n+\n+echo \"###################################################################\"","path":"ldap_check.sh","position":118,"original_position":118,"commit_id":"1e0b8ff84895964f574764f4ad225bf02f323f85","original_commit_id":"1e0b8ff84895964f574764f4ad225bf02f323f85","user":{"login":"jamesbrown7","id":5472946,"avatar_url":"https://avatars.githubusercontent.com/u/5472946?v=3","gravatar_id":"","url":"https://api.github.com/users/jamesbrown7","html_url":"https://github.com/jamesbrown7","followers_url":"https://api.github.com/users/jamesbrown7/followers","following_url":"https://api.github.com/users/jamesbrown7/following{/other_user}","gists_url":"https://api.github.com/users/jamesbrown7/gists{/gist_id}","starred_url":"https://api.github.com/users/jamesbrown7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jamesbrown7/subscriptions","organizations_url":"https://api.github.com/users/jamesbrown7/orgs","repos_url":"https://api.github.com/users/jamesbrown7/repos","events_url":"https://api.github.com/users/jamesbrown7/events{/privacy}","received_events_url":"https://api.github.com/users/jamesbrown7/received_events","type":"User","site_admin":false},"body":"Another here-document would be cleaner here.","created_at":"2016-03-08T20:55:12Z","updated_at":"2016-03-08T20:55:12Z","html_url":"https://github.com/TheJumpCloud/Extensions/pull/2#discussion_r55425668","pull_request_url":"https://api.github.com/repos/TheJumpCloud/Extensions/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/TheJumpCloud/Extensions/pulls/comments/55425668"},"html":{"href":"https://github.com/TheJumpCloud/Extensions/pull/2#discussion_r55425668"},"pull_request":{"href":"https://api.github.com/repos/TheJumpCloud/Extensions/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/TheJumpCloud/Extensions/pulls/2","id":62133754,"html_url":"https://github.com/TheJumpCloud/Extensions/pull/2","diff_url":"https://github.com/TheJumpCloud/Extensions/pull/2.diff","patch_url":"https://github.com/TheJumpCloud/Extensions/pull/2.patch","issue_url":"https://api.github.com/repos/TheJumpCloud/Extensions/issues/2","number":2,"state":"open","locked":false,"title":"init commit ldap_check.sh","user":{"login":"scaryfast","id":1869404,"avatar_url":"https://avatars.githubusercontent.com/u/1869404?v=3","gravatar_id":"","url":"https://api.github.com/users/scaryfast","html_url":"https://github.com/scaryfast","followers_url":"https://api.github.com/users/scaryfast/followers","following_url":"https://api.github.com/users/scaryfast/following{/other_user}","gists_url":"https://api.github.com/users/scaryfast/gists{/gist_id}","starred_url":"https://api.github.com/users/scaryfast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scaryfast/subscriptions","organizations_url":"https://api.github.com/users/scaryfast/orgs","repos_url":"https://api.github.com/users/scaryfast/repos","events_url":"https://api.github.com/users/scaryfast/events{/privacy}","received_events_url":"https://api.github.com/users/scaryfast/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-03-08T20:48:52Z","updated_at":"2016-03-08T20:55:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a28aff1b3e72226a43ac50f9bfe1db8153d10163","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/TheJumpCloud/Extensions/pulls/2/commits","review_comments_url":"https://api.github.com/repos/TheJumpCloud/Extensions/pulls/2/comments","review_comment_url":"https://api.github.com/repos/TheJumpCloud/Extensions/pulls/comments{/number}","comments_url":"https://api.github.com/repos/TheJumpCloud/Extensions/issues/2/comments","statuses_url":"https://api.github.com/repos/TheJumpCloud/Extensions/statuses/1e0b8ff84895964f574764f4ad225bf02f323f85","head":{"label":"scaryfast:master","ref":"master","sha":"1e0b8ff84895964f574764f4ad225bf02f323f85","user":{"login":"scaryfast","id":1869404,"avatar_url":"https://avatars.githubusercontent.com/u/1869404?v=3","gravatar_id":"","url":"https://api.github.com/users/scaryfast","html_url":"https://github.com/scaryfast","followers_url":"https://api.github.com/users/scaryfast/followers","following_url":"https://api.github.com/users/scaryfast/following{/other_user}","gists_url":"https://api.github.com/users/scaryfast/gists{/gist_id}","starred_url":"https://api.github.com/users/scaryfast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scaryfast/subscriptions","organizations_url":"https://api.github.com/users/scaryfast/orgs","repos_url":"https://api.github.com/users/scaryfast/repos","events_url":"https://api.github.com/users/scaryfast/events{/privacy}","received_events_url":"https://api.github.com/users/scaryfast/received_events","type":"User","site_admin":false},"repo":{"id":53443989,"name":"Extensions","full_name":"scaryfast/Extensions","owner":{"login":"scaryfast","id":1869404,"avatar_url":"https://avatars.githubusercontent.com/u/1869404?v=3","gravatar_id":"","url":"https://api.github.com/users/scaryfast","html_url":"https://github.com/scaryfast","followers_url":"https://api.github.com/users/scaryfast/followers","following_url":"https://api.github.com/users/scaryfast/following{/other_user}","gists_url":"https://api.github.com/users/scaryfast/gists{/gist_id}","starred_url":"https://api.github.com/users/scaryfast/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scaryfast/subscriptions","organizations_url":"https://api.github.com/users/scaryfast/orgs","repos_url":"https://api.github.com/users/scaryfast/repos","events_url":"https://api.github.com/users/scaryfast/events{/privacy}","received_events_url":"https://api.github.com/users/scaryfast/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/scaryfast/Extensions","description":"Contains function and feature extensions, code examples, and utilities for JumpCloud, including automated user import, CSV import, and others","fork":true,"url":"https://api.github.com/repos/scaryfast/Extensions","forks_url":"https://api.github.com/repos/scaryfast/Extensions/forks","keys_url":"https://api.github.com/repos/scaryfast/Extensions/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scaryfast/Extensions/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scaryfast/Extensions/teams","hooks_url":"https://api.github.com/repos/scaryfast/Extensions/hooks","issue_events_url":"https://api.github.com/repos/scaryfast/Extensions/issues/events{/number}","events_url":"https://api.github.com/repos/scaryfast/Extensions/events","assignees_url":"https://api.github.com/repos/scaryfast/Extensions/assignees{/user}","branches_url":"https://api.github.com/repos/scaryfast/Extensions/branches{/branch}","tags_url":"https://api.github.com/repos/scaryfast/Extensions/tags","blobs_url":"https://api.github.com/repos/scaryfast/Extensions/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scaryfast/Extensions/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scaryfast/Extensions/git/refs{/sha}","trees_url":"https://api.github.com/repos/scaryfast/Extensions/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scaryfast/Extensions/statuses/{sha}","languages_url":"https://api.github.com/repos/scaryfast/Extensions/languages","stargazers_url":"https://api.github.com/repos/scaryfast/Extensions/stargazers","contributors_url":"https://api.github.com/repos/scaryfast/Extensions/contributors","subscribers_url":"https://api.github.com/repos/scaryfast/Extensions/subscribers","subscription_url":"https://api.github.com/repos/scaryfast/Extensions/subscription","commits_url":"https://api.github.com/repos/scaryfast/Extensions/commits{/sha}","git_commits_url":"https://api.github.com/repos/scaryfast/Extensions/git/commits{/sha}","comments_url":"https://api.github.com/repos/scaryfast/Extensions/comments{/number}","issue_comment_url":"https://api.github.com/repos/scaryfast/Extensions/issues/comments{/number}","contents_url":"https://api.github.com/repos/scaryfast/Extensions/contents/{+path}","compare_url":"https://api.github.com/repos/scaryfast/Extensions/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scaryfast/Extensions/merges","archive_url":"https://api.github.com/repos/scaryfast/Extensions/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scaryfast/Extensions/downloads","issues_url":"https://api.github.com/repos/scaryfast/Extensions/issues{/number}","pulls_url":"https://api.github.com/repos/scaryfast/Extensions/pulls{/number}","milestones_url":"https://api.github.com/repos/scaryfast/Extensions/milestones{/number}","notifications_url":"https://api.github.com/repos/scaryfast/Extensions/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scaryfast/Extensions/labels{/name}","releases_url":"https://api.github.com/repos/scaryfast/Extensions/releases{/id}","deployments_url":"https://api.github.com/repos/scaryfast/Extensions/deployments","created_at":"2016-03-08T20:46:52Z","updated_at":"2016-03-08T20:46:52Z","pushed_at":"2016-03-08T20:48:28Z","git_url":"git://github.com/scaryfast/Extensions.git","ssh_url":"git@github.com:scaryfast/Extensions.git","clone_url":"https://github.com/scaryfast/Extensions.git","svn_url":"https://github.com/scaryfast/Extensions","homepage":"https://www.jumpcloud.com","size":19,"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":"TheJumpCloud:master","ref":"master","sha":"838855cfb7a0eed7d988b5337b63c5c25d3affb7","user":{"login":"TheJumpCloud","id":4927461,"avatar_url":"https://avatars.githubusercontent.com/u/4927461?v=3","gravatar_id":"","url":"https://api.github.com/users/TheJumpCloud","html_url":"https://github.com/TheJumpCloud","followers_url":"https://api.github.com/users/TheJumpCloud/followers","following_url":"https://api.github.com/users/TheJumpCloud/following{/other_user}","gists_url":"https://api.github.com/users/TheJumpCloud/gists{/gist_id}","starred_url":"https://api.github.com/users/TheJumpCloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TheJumpCloud/subscriptions","organizations_url":"https://api.github.com/users/TheJumpCloud/orgs","repos_url":"https://api.github.com/users/TheJumpCloud/repos","events_url":"https://api.github.com/users/TheJumpCloud/events{/privacy}","received_events_url":"https://api.github.com/users/TheJumpCloud/received_events","type":"Organization","site_admin":false},"repo":{"id":18682210,"name":"Extensions","full_name":"TheJumpCloud/Extensions","owner":{"login":"TheJumpCloud","id":4927461,"avatar_url":"https://avatars.githubusercontent.com/u/4927461?v=3","gravatar_id":"","url":"https://api.github.com/users/TheJumpCloud","html_url":"https://github.com/TheJumpCloud","followers_url":"https://api.github.com/users/TheJumpCloud/followers","following_url":"https://api.github.com/users/TheJumpCloud/following{/other_user}","gists_url":"https://api.github.com/users/TheJumpCloud/gists{/gist_id}","starred_url":"https://api.github.com/users/TheJumpCloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TheJumpCloud/subscriptions","organizations_url":"https://api.github.com/users/TheJumpCloud/orgs","repos_url":"https://api.github.com/users/TheJumpCloud/repos","events_url":"https://api.github.com/users/TheJumpCloud/events{/privacy}","received_events_url":"https://api.github.com/users/TheJumpCloud/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/TheJumpCloud/Extensions","description":"Contains function and feature extensions, code examples, and utilities for JumpCloud, including automated user import, CSV import, and others","fork":false,"url":"https://api.github.com/repos/TheJumpCloud/Extensions","forks_url":"https://api.github.com/repos/TheJumpCloud/Extensions/forks","keys_url":"https://api.github.com/repos/TheJumpCloud/Extensions/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TheJumpCloud/Extensions/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TheJumpCloud/Extensions/teams","hooks_url":"https://api.github.com/repos/TheJumpCloud/Extensions/hooks","issue_events_url":"https://api.github.com/repos/TheJumpCloud/Extensions/issues/events{/number}","events_url":"https://api.github.com/repos/TheJumpCloud/Extensions/events","assignees_url":"https://api.github.com/repos/TheJumpCloud/Extensions/assignees{/user}","branches_url":"https://api.github.com/repos/TheJumpCloud/Extensions/branches{/branch}","tags_url":"https://api.github.com/repos/TheJumpCloud/Extensions/tags","blobs_url":"https://api.github.com/repos/TheJumpCloud/Extensions/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TheJumpCloud/Extensions/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TheJumpCloud/Extensions/git/refs{/sha}","trees_url":"https://api.github.com/repos/TheJumpCloud/Extensions/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TheJumpCloud/Extensions/statuses/{sha}","languages_url":"https://api.github.com/repos/TheJumpCloud/Extensions/languages","stargazers_url":"https://api.github.com/repos/TheJumpCloud/Extensions/stargazers","contributors_url":"https://api.github.com/repos/TheJumpCloud/Extensions/contributors","subscribers_url":"https://api.github.com/repos/TheJumpCloud/Extensions/subscribers","subscription_url":"https://api.github.com/repos/TheJumpCloud/Extensions/subscription","commits_url":"https://api.github.com/repos/TheJumpCloud/Extensions/commits{/sha}","git_commits_url":"https://api.github.com/repos/TheJumpCloud/Extensions/git/commits{/sha}","comments_url":"https://api.github.com/repos/TheJumpCloud/Extensions/comments{/number}","issue_comment_url":"https://api.github.com/repos/TheJumpCloud/Extensions/issues/comments{/number}","contents_url":"https://api.github.com/repos/TheJumpCloud/Extensions/contents/{+path}","compare_url":"https://api.github.com/repos/TheJumpCloud/Extensions/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TheJumpCloud/Extensions/merges","archive_url":"https://api.github.com/repos/TheJumpCloud/Extensions/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TheJumpCloud/Extensions/downloads","issues_url":"https://api.github.com/repos/TheJumpCloud/Extensions/issues{/number}","pulls_url":"https://api.github.com/repos/TheJumpCloud/Extensions/pulls{/number}","milestones_url":"https://api.github.com/repos/TheJumpCloud/Extensions/milestones{/number}","notifications_url":"https://api.github.com/repos/TheJumpCloud/Extensions/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TheJumpCloud/Extensions/labels{/name}","releases_url":"https://api.github.com/repos/TheJumpCloud/Extensions/releases{/id}","deployments_url":"https://api.github.com/repos/TheJumpCloud/Extensions/deployments","created_at":"2014-04-11T17:11:31Z","updated_at":"2015-04-13T16:41:28Z","pushed_at":"2016-03-08T20:48:52Z","git_url":"git://github.com/TheJumpCloud/Extensions.git","ssh_url":"git@github.com:TheJumpCloud/Extensions.git","clone_url":"https://github.com/TheJumpCloud/Extensions.git","svn_url":"https://github.com/TheJumpCloud/Extensions","homepage":"https://www.jumpcloud.com","size":177,"stargazers_count":2,"watchers_count":2,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":2,"forks":3,"open_issues":2,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/TheJumpCloud/Extensions/pulls/2"},"html":{"href":"https://github.com/TheJumpCloud/Extensions/pull/2"},"issue":{"href":"https://api.github.com/repos/TheJumpCloud/Extensions/issues/2"},"comments":{"href":"https://api.github.com/repos/TheJumpCloud/Extensions/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/TheJumpCloud/Extensions/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/TheJumpCloud/Extensions/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/TheJumpCloud/Extensions/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/TheJumpCloud/Extensions/statuses/1e0b8ff84895964f574764f4ad225bf02f323f85"}}}}