summaryrefslogtreecommitdiff
path: root/ec2-set-hostname.py
diff options
context:
space:
mode:
Diffstat (limited to 'ec2-set-hostname.py')
-rwxr-xr-xec2-set-hostname.py6
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()