diff options
Diffstat (limited to 'ec2-set-hostname.py')
-rwxr-xr-x | ec2-set-hostname.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ec2-set-hostname.py b/ec2-set-hostname.py index 818d0e02..c4e56fc9 100755 --- a/ec2-set-hostname.py +++ b/ec2-set-hostname.py @@ -49,6 +49,12 @@ def set_hostname(filename): f = open("/etc/hosts", "w") f.write('%s' %(t)) f.close() + + os.system("rm /etc/hostname") + f = open("/etc/hostname", "w") + f.write('%s' %(t)) + f.close() + os.system('touch %s' %(filename)) id = get_ami_id() |