{"action":"created","comment":{"url":"https://api.github.com/repos/rightscale/rightlink_scripts/pulls/comments/32281471","id":32281471,"diff_hunk":"@@ -0,0 +1,64 @@\n+# On AWS, if an elastic IP address is specified this script will wait until all API Hosts are\n+# reporting the expected IP address for the server, which is recorded in the user-data\n+\n+$RS_DIR = 'C:\\ProgramData\\RightScale\\RightLink'\n+$RS_ID_FILE = \"${RS_DIR}\\rightscale-identity\"\n+\n+foreach ($line in (Get-Content $RS_ID_FILE)) {\n+  if ($line -match 'expected_public_ip=(.+)') {\n+    $expectedPublicIP = $matches[1]\n+  } elseif ($line -match 'api_hostname=(.+)') {\n+    $apiHostname = $matches[1]\n+  }\n+}\n+\n+if (!$expectedPublicIP) {\n+  Write-Output 'No public IP address to wait for'\n+  Exit 0\n+}\n+\n+$rfc1918 = '^(192\\.168|10\\.|172\\.1[6789]\\.|172\\.2[0-9]\\.|172\\.3[01]\\.)'\n+if ($expectedPublicIP -match $rfc1918) {\n+  Write-Output \"External IP is within rfc1918 range: ${expectedPublicIP}, not waiting\"\n+  Exit 0\n+}\n+Write-Output \"Expecting to be assigned public IP ${expectedPublicIP}\"\n+\n+$targets = @('my.rightscale.com', 'us-3.rightscale.com', 'us-4.rightscale.com', 'island1.rightscale.com', 'island10.rightscale.com', $api_hostname)\n+Write-Output \"Checking public IP against ${targets}\"\n+\n+# spend at most 15 minutes checking the API hosts for either the expected IP address or an incorrect IP address\n+$startTime = Get-Date\n+$wc = New-Object System.Net.WebClient\n+while ((New-TimeSpan -Start $startTime -End (Get-Date)).TotalSeconds -lt 900) {","path":"rlw/wait-for-eip.ps1","position":33,"original_position":33,"commit_id":"28be1750e23bb9b01e8c37fd1451469db3229985","original_commit_id":"28be1750e23bb9b01e8c37fd1451469db3229985","user":{"login":"douglaswth","id":77890,"avatar_url":"https://avatars.githubusercontent.com/u/77890?v=3","gravatar_id":"","url":"https://api.github.com/users/douglaswth","html_url":"https://github.com/douglaswth","followers_url":"https://api.github.com/users/douglaswth/followers","following_url":"https://api.github.com/users/douglaswth/following{/other_user}","gists_url":"https://api.github.com/users/douglaswth/gists{/gist_id}","starred_url":"https://api.github.com/users/douglaswth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/douglaswth/subscriptions","organizations_url":"https://api.github.com/users/douglaswth/orgs","repos_url":"https://api.github.com/users/douglaswth/repos","events_url":"https://api.github.com/users/douglaswth/events{/privacy}","received_events_url":"https://api.github.com/users/douglaswth/received_events","type":"User","site_admin":false},"body":"Why not use `.TotalMinutes -lt 15`?","created_at":"2015-06-12T00:09:35Z","updated_at":"2015-06-12T00:09:35Z","html_url":"https://github.com/rightscale/rightlink_scripts/pull/27#discussion_r32281471","pull_request_url":"https://api.github.com/repos/rightscale/rightlink_scripts/pulls/27","_links":{"self":{"href":"https://api.github.com/repos/rightscale/rightlink_scripts/pulls/comments/32281471"},"html":{"href":"https://github.com/rightscale/rightlink_scripts/pull/27#discussion_r32281471"},"pull_request":{"href":"https://api.github.com/repos/rightscale/rightlink_scripts/pulls/27"}}},"pull_request":{"url":"https://api.github.com/repos/rightscale/rightlink_scripts/pulls/27","id":37485484,"html_url":"https://github.com/rightscale/rightlink_scripts/pull/27","diff_url":"https://github.com/rightscale/rightlink_scripts/pull/27.diff","patch_url":"https://github.com/rightscale/rightlink_scripts/pull/27.patch","issue_url":"https://api.github.com/repos/rightscale/rightlink_scripts/issues/27","number":27,"state":"open","locked":false,"title":"Iv 1472 powershell scripts","user":{"login":"Maimer","id":6377583,"avatar_url":"https://avatars.githubusercontent.com/u/6377583?v=3","gravatar_id":"","url":"https://api.github.com/users/Maimer","html_url":"https://github.com/Maimer","followers_url":"https://api.github.com/users/Maimer/followers","following_url":"https://api.github.com/users/Maimer/following{/other_user}","gists_url":"https://api.github.com/users/Maimer/gists{/gist_id}","starred_url":"https://api.github.com/users/Maimer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Maimer/subscriptions","organizations_url":"https://api.github.com/users/Maimer/orgs","repos_url":"https://api.github.com/users/Maimer/repos","events_url":"https://api.github.com/users/Maimer/events{/privacy}","received_events_url":"https://api.github.com/users/Maimer/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-06-11T16:59:26Z","updated_at":"2015-06-12T00:09:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4006776685684a7b8bd804a228829227f500789d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rightscale/rightlink_scripts/pulls/27/commits","review_comments_url":"https://api.github.com/repos/rightscale/rightlink_scripts/pulls/27/comments","review_comment_url":"https://api.github.com/repos/rightscale/rightlink_scripts/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rightscale/rightlink_scripts/issues/27/comments","statuses_url":"https://api.github.com/repos/rightscale/rightlink_scripts/statuses/28be1750e23bb9b01e8c37fd1451469db3229985","head":{"label":"rightscale:IV-1472_powershell_scripts","ref":"IV-1472_powershell_scripts","sha":"28be1750e23bb9b01e8c37fd1451469db3229985","user":{"login":"rightscale","id":27964,"avatar_url":"https://avatars.githubusercontent.com/u/27964?v=3","gravatar_id":"","url":"https://api.github.com/users/rightscale","html_url":"https://github.com/rightscale","followers_url":"https://api.github.com/users/rightscale/followers","following_url":"https://api.github.com/users/rightscale/following{/other_user}","gists_url":"https://api.github.com/users/rightscale/gists{/gist_id}","starred_url":"https://api.github.com/users/rightscale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rightscale/subscriptions","organizations_url":"https://api.github.com/users/rightscale/orgs","repos_url":"https://api.github.com/users/rightscale/repos","events_url":"https://api.github.com/users/rightscale/events{/privacy}","received_events_url":"https://api.github.com/users/rightscale/received_events","type":"Organization","site_admin":false},"repo":{"id":28283820,"name":"rightlink_scripts","full_name":"rightscale/rightlink_scripts","owner":{"login":"rightscale","id":27964,"avatar_url":"https://avatars.githubusercontent.com/u/27964?v=3","gravatar_id":"","url":"https://api.github.com/users/rightscale","html_url":"https://github.com/rightscale","followers_url":"https://api.github.com/users/rightscale/followers","following_url":"https://api.github.com/users/rightscale/following{/other_user}","gists_url":"https://api.github.com/users/rightscale/gists{/gist_id}","starred_url":"https://api.github.com/users/rightscale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rightscale/subscriptions","organizations_url":"https://api.github.com/users/rightscale/orgs","repos_url":"https://api.github.com/users/rightscale/repos","events_url":"https://api.github.com/users/rightscale/events{/privacy}","received_events_url":"https://api.github.com/users/rightscale/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rightscale/rightlink_scripts","description":"RightScripts for RightScale's RightLink10 (aka RightLinkLite) agent","fork":false,"url":"https://api.github.com/repos/rightscale/rightlink_scripts","forks_url":"https://api.github.com/repos/rightscale/rightlink_scripts/forks","keys_url":"https://api.github.com/repos/rightscale/rightlink_scripts/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rightscale/rightlink_scripts/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rightscale/rightlink_scripts/teams","hooks_url":"https://api.github.com/repos/rightscale/rightlink_scripts/hooks","issue_events_url":"https://api.github.com/repos/rightscale/rightlink_scripts/issues/events{/number}","events_url":"https://api.github.com/repos/rightscale/rightlink_scripts/events","assignees_url":"https://api.github.com/repos/rightscale/rightlink_scripts/assignees{/user}","branches_url":"https://api.github.com/repos/rightscale/rightlink_scripts/branches{/branch}","tags_url":"https://api.github.com/repos/rightscale/rightlink_scripts/tags","blobs_url":"https://api.github.com/repos/rightscale/rightlink_scripts/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rightscale/rightlink_scripts/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rightscale/rightlink_scripts/git/refs{/sha}","trees_url":"https://api.github.com/repos/rightscale/rightlink_scripts/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rightscale/rightlink_scripts/statuses/{sha}","languages_url":"https://api.github.com/repos/rightscale/rightlink_scripts/languages","stargazers_url":"https://api.github.com/repos/rightscale/rightlink_scripts/stargazers","contributors_url":"https://api.github.com/repos/rightscale/rightlink_scripts/contributors","subscribers_url":"https://api.github.com/repos/rightscale/rightlink_scripts/subscribers","subscription_url":"https://api.github.com/repos/rightscale/rightlink_scripts/subscription","commits_url":"https://api.github.com/repos/rightscale/rightlink_scripts/commits{/sha}","git_commits_url":"https://api.github.com/repos/rightscale/rightlink_scripts/git/commits{/sha}","comments_url":"https://api.github.com/repos/rightscale/rightlink_scripts/comments{/number}","issue_comment_url":"https://api.github.com/repos/rightscale/rightlink_scripts/issues/comments{/number}","contents_url":"https://api.github.com/repos/rightscale/rightlink_scripts/contents/{+path}","compare_url":"https://api.github.com/repos/rightscale/rightlink_scripts/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rightscale/rightlink_scripts/merges","archive_url":"https://api.github.com/repos/rightscale/rightlink_scripts/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rightscale/rightlink_scripts/downloads","issues_url":"https://api.github.com/repos/rightscale/rightlink_scripts/issues{/number}","pulls_url":"https://api.github.com/repos/rightscale/rightlink_scripts/pulls{/number}","milestones_url":"https://api.github.com/repos/rightscale/rightlink_scripts/milestones{/number}","notifications_url":"https://api.github.com/repos/rightscale/rightlink_scripts/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rightscale/rightlink_scripts/labels{/name}","releases_url":"https://api.github.com/repos/rightscale/rightlink_scripts/releases{/id}","created_at":"2014-12-21T00:41:29Z","updated_at":"2015-05-07T21:58:14Z","pushed_at":"2015-06-11T22:03:16Z","git_url":"git://github.com/rightscale/rightlink_scripts.git","ssh_url":"git@github.com:rightscale/rightlink_scripts.git","clone_url":"https://github.com/rightscale/rightlink_scripts.git","svn_url":"https://github.com/rightscale/rightlink_scripts","homepage":null,"size":747,"stargazers_count":0,"watchers_count":0,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":2,"forks":5,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"rightscale:master","ref":"master","sha":"ed7b7c4334dbd2bd14ac639fce97a09e46e4a570","user":{"login":"rightscale","id":27964,"avatar_url":"https://avatars.githubusercontent.com/u/27964?v=3","gravatar_id":"","url":"https://api.github.com/users/rightscale","html_url":"https://github.com/rightscale","followers_url":"https://api.github.com/users/rightscale/followers","following_url":"https://api.github.com/users/rightscale/following{/other_user}","gists_url":"https://api.github.com/users/rightscale/gists{/gist_id}","starred_url":"https://api.github.com/users/rightscale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rightscale/subscriptions","organizations_url":"https://api.github.com/users/rightscale/orgs","repos_url":"https://api.github.com/users/rightscale/repos","events_url":"https://api.github.com/users/rightscale/events{/privacy}","received_events_url":"https://api.github.com/users/rightscale/received_events","type":"Organization","site_admin":false},"repo":{"id":28283820,"name":"rightlink_scripts","full_name":"rightscale/rightlink_scripts","owner":{"login":"rightscale","id":27964,"avatar_url":"https://avatars.githubusercontent.com/u/27964?v=3","gravatar_id":"","url":"https://api.github.com/users/rightscale","html_url":"https://github.com/rightscale","followers_url":"https://api.github.com/users/rightscale/followers","following_url":"https://api.github.com/users/rightscale/following{/other_user}","gists_url":"https://api.github.com/users/rightscale/gists{/gist_id}","starred_url":"https://api.github.com/users/rightscale/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rightscale/subscriptions","organizations_url":"https://api.github.com/users/rightscale/orgs","repos_url":"https://api.github.com/users/rightscale/repos","events_url":"https://api.github.com/users/rightscale/events{/privacy}","received_events_url":"https://api.github.com/users/rightscale/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rightscale/rightlink_scripts","description":"RightScripts for RightScale's RightLink10 (aka RightLinkLite) agent","fork":false,"url":"https://api.github.com/repos/rightscale/rightlink_scripts","forks_url":"https://api.github.com/repos/rightscale/rightlink_scripts/forks","keys_url":"https://api.github.com/repos/rightscale/rightlink_scripts/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rightscale/rightlink_scripts/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rightscale/rightlink_scripts/teams","hooks_url":"https://api.github.com/repos/rightscale/rightlink_scripts/hooks","issue_events_url":"https://api.github.com/repos/rightscale/rightlink_scripts/issues/events{/number}","events_url":"https://api.github.com/repos/rightscale/rightlink_scripts/events","assignees_url":"https://api.github.com/repos/rightscale/rightlink_scripts/assignees{/user}","branches_url":"https://api.github.com/repos/rightscale/rightlink_scripts/branches{/branch}","tags_url":"https://api.github.com/repos/rightscale/rightlink_scripts/tags","blobs_url":"https://api.github.com/repos/rightscale/rightlink_scripts/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rightscale/rightlink_scripts/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rightscale/rightlink_scripts/git/refs{/sha}","trees_url":"https://api.github.com/repos/rightscale/rightlink_scripts/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rightscale/rightlink_scripts/statuses/{sha}","languages_url":"https://api.github.com/repos/rightscale/rightlink_scripts/languages","stargazers_url":"https://api.github.com/repos/rightscale/rightlink_scripts/stargazers","contributors_url":"https://api.github.com/repos/rightscale/rightlink_scripts/contributors","subscribers_url":"https://api.github.com/repos/rightscale/rightlink_scripts/subscribers","subscription_url":"https://api.github.com/repos/rightscale/rightlink_scripts/subscription","commits_url":"https://api.github.com/repos/rightscale/rightlink_scripts/commits{/sha}","git_commits_url":"https://api.github.com/repos/rightscale/rightlink_scripts/git/commits{/sha}","comments_url":"https://api.github.com/repos/rightscale/rightlink_scripts/comments{/number}","issue_comment_url":"https://api.github.com/repos/rightscale/rightlink_scripts/issues/comments{/number}","contents_url":"https://api.github.com/repos/rightscale/rightlink_scripts/contents/{+path}","compare_url":"https://api.github.com/repos/rightscale/rightlink_scripts/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rightscale/rightlink_scripts/merges","archive_url":"https://api.github.com/repos/rightscale/rightlink_scripts/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rightscale/rightlink_scripts/downloads","issues_url":"https://api.github.com/repos/rightscale/rightlink_scripts/issues{/number}","pulls_url":"https://api.github.com/repos/rightscale/rightlink_scripts/pulls{/number}","milestones_url":"https://api.github.com/repos/rightscale/rightlink_scripts/milestones{/number}","notifications_url":"https://api.github.com/repos/rightscale/rightlink_scripts/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rightscale/rightlink_scripts/labels{/name}","releases_url":"https://api.github.com/repos/rightscale/rightlink_scripts/releases{/id}","created_at":"2014-12-21T00:41:29Z","updated_at":"2015-05-07T21:58:14Z","pushed_at":"2015-06-11T22:03:16Z","git_url":"git://github.com/rightscale/rightlink_scripts.git","ssh_url":"git@github.com:rightscale/rightlink_scripts.git","clone_url":"https://github.com/rightscale/rightlink_scripts.git","svn_url":"https://github.com/rightscale/rightlink_scripts","homepage":null,"size":747,"stargazers_count":0,"watchers_count":0,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":2,"forks":5,"open_issues":2,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rightscale/rightlink_scripts/pulls/27"},"html":{"href":"https://github.com/rightscale/rightlink_scripts/pull/27"},"issue":{"href":"https://api.github.com/repos/rightscale/rightlink_scripts/issues/27"},"comments":{"href":"https://api.github.com/repos/rightscale/rightlink_scripts/issues/27/comments"},"review_comments":{"href":"https://api.github.com/repos/rightscale/rightlink_scripts/pulls/27/comments"},"review_comment":{"href":"https://api.github.com/repos/rightscale/rightlink_scripts/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rightscale/rightlink_scripts/pulls/27/commits"},"statuses":{"href":"https://api.github.com/repos/rightscale/rightlink_scripts/statuses/28be1750e23bb9b01e8c37fd1451469db3229985"}}}}