Revision 18b4d7d0 snf-image-helper/tasks/50AssignHostname.in
b/snf-image-helper/tasks/50AssignHostname.in | ||
---|---|---|
70 | 70 |
gentoo) |
71 | 71 |
sed -ie "s/\(\(HOSTNAME\)\|\(hostname\)\)=.*$/\1=\"$hostname\"/" "$target/etc/conf.d/hostname";; |
72 | 72 |
arch) |
73 |
# In newer archlinux systems /etc/hostname is used to assign the hostname |
|
74 |
if [[ -f "$target/etc/hostname" ]]; then |
|
75 |
echo "$hostname" > "$target/etc/hostname" |
|
76 |
fi |
|
77 |
# Older ones use the HOSTNAME variable in /etc/rc.conf |
|
73 | 78 |
sed -ie "s/^HOSTNAME=.*$/HOSTNAME=\"$hostname\"/" "$target/etc/rc.conf" |
74 | 79 |
if grep "^127\.0\.0\.1[ \t]*" "$target/etc/hosts" > /dev/null; then |
75 | 80 |
sed -ie "s/127\.0\.0\.1[ \t]*.*$/127.0.0.1\t$hostname/" "$target/etc/hosts" |
Also available in: Unified diff