diff options
Diffstat (limited to 'ec2-run-user-data.py')
-rwxr-xr-x | ec2-run-user-data.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/ec2-run-user-data.py b/ec2-run-user-data.py index 63820bed..56e5e538 100755 --- a/ec2-run-user-data.py +++ b/ec2-run-user-data.py @@ -47,16 +47,14 @@ filename = '/var/ec2/.already-ran.%s' % amiId if os.path.exists(filename): print "ec2-run-user-data already ran for this instance." sys.exit(0) -else: - if user_data.startswith('#!'): +elif user_data.startswith('#!'): # run it (fp, path) = tempfile.mkstemp() os.write(fp,user_data) os.close(fp); os.chmod(path, 0700) - os.system('cp %s /var/ec2/user-data' %(path)) - status = os.system('%s' % path) + status = os.system('%s | logger -t "user-data" ' % path) os.unlink(path) - os.system('touch /var/ec2/$s' %(filename)) + os.system('touch %s' %(filename)) sys.exit(0) |