Skip to content

Commit

Permalink
Updated IP address retrieval to differential bw mac and linux
Browse files Browse the repository at this point in the history
  • Loading branch information
mcianfrocco committed Aug 10, 2017
1 parent e3d9c78 commit 0ed1667
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions aws/launch_AWS_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,13 @@ def launchInstance(params,keyName,keyPath,AMI,AWS_ACCOUNT_ID):
uname=subprocess.Popen('uname',shell=True, stdout=subprocess.PIPE).stdout.read().strip()
securityGroupName='sg_%i' %(int(time.time()))
securityGroupDescript='Automated security group'
#if uname == 'Linux':
IPaddress=subprocess.Popen('curl -s ipecho.net/plain; echo',shell=True, stdout=subprocess.PIPE).stdout.read().strip()
if uname == 'Linux':
IPaddress=subprocess.Popen('curl -s ipecho.net/plain; echo',shell=True, stdout=subprocess.PIPE).stdout.read().strip()

if uname == 'Darwin'
IPaddress=subprocess.Popen('curl -s ipecho.net | grep "Your IP is" | sed -e "s/^.* //" -e "s/\<.*$//"',shell=True, stdout=subprocess.PIPE).stdout.read().strip()

#IPaddress=subprocess.Popen('curl -s ipecho.net/plain; echo',shell=True, stdout=subprocess.PIPE).stdout.read().strip()
#if uname == 'Darwin':
#IPaddress=subprocess.Popen('curl ipecho.net/plain ; echo',shell=True, stdout=subprocess.PIPE).stdout.read().strip()
if len(IPaddress) == 0:
Expand Down
2 changes: 1 addition & 1 deletion compile_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import subprocess

notincluded=['aws_init.sh','rclone','rclone_mac','aws_init.sh','s3tmpout.txt']
outdirname='aws_build_osx' #Choices: aws_build_linux, aws_build_osx
outdirname='aws_build_linux' #Choices: aws_build_linux, aws_build_osx
filelist=glob.glob('aws/*')

for f in filelist:
Expand Down

0 comments on commit 0ed1667

Please sign in to comment.