430d0a00599a6b5857035f22971bdac59fef2179
[live-boot-grml.git] / scripts / live-bottom / 18hostname
1 #!/bin/sh
2
3 #set -e
4
5 # initramfs-tools header
6
7 PREREQ=""
8
9 prereqs()
10 {
11         echo "${PREREQ}"
12 }
13
14 case "${1}" in
15         prereqs)
16                 prereqs
17                 exit 0
18                 ;;
19 esac
20
21 # live-initramfs header
22
23 . /scripts/live-functions
24
25 log_begin_msg "Setting hostname..."
26
27 # live-initramfs script
28
29 echo "$HOSTNAME" > /root/etc/hostname
30 cat >> /root/etc/hosts <<EOF
31 127.0.0.1 localhost
32 127.0.1.1 $HOSTNAME
33
34 # The following lines are desirable for IPv6 capable hosts
35 ::1     ip6-localhost ip6-loopback
36 fe00::0 ip6-localnet
37 ff00::0 ip6-mcastprefix
38 ff02::1 ip6-allnodes
39 ff02::2 ip6-allrouters
40 ff02::3 ip6-allhosts
41
42 EOF
43
44 log_end_msg