home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / usr / share / initramfs-tools / scripts / casper-bottom / 18hostname < prev    next >
Encoding:
Text File  |  2006-05-11  |  553 b   |  39 lines

  1. #! /bin/sh
  2.  
  3. PREREQ=""
  4. DESCRIPTION="Setting hostname..."
  5.  
  6. . /scripts/functions
  7.  
  8. prereqs()
  9. {
  10.        echo "$PREREQ"
  11. }
  12.  
  13. case $1 in
  14. # get pre-requisites
  15. prereqs)
  16.        prereqs
  17.        exit 0
  18.        ;;
  19. esac
  20.  
  21. log_begin_msg "$DESCRIPTION"
  22.  
  23. echo "$HOST" > /root/etc/hostname
  24. cat > /root/etc/hosts <<EOF
  25. 127.0.0.1 localhost
  26. 127.0.1.1 $HOST
  27.  
  28. # The following lines are desirable for IPv6 capable hosts
  29. ::1     ip6-localhost ip6-loopback
  30. fe00::0 ip6-localnet
  31. ff00::0 ip6-mcastprefix
  32. ff02::1 ip6-allnodes
  33. ff02::2 ip6-allrouters
  34. ff02::3 ip6-allhosts
  35.  
  36. EOF
  37.  
  38. log_end_msg
  39.