mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
600 B

  1. dns_init() {
  2. if isfirst "dns"; then
  3. addcode up 4 1 "echo -n "" > /etc/resolv.conf"
  4. fi
  5. }
  6. public_nameserver() {
  7. addcode up 4 5 "echo nameserver $1 >> /etc/resolv.conf"
  8. dns_init
  9. }
  10. public_search() {
  11. if ! isfirst "dns_search"; then
  12. error "Keyword >>search<< not allowed multiple times."
  13. return
  14. fi
  15. addcode up 4 4 "echo search $* >> /etc/resolv.conf"
  16. dns_init
  17. }
  18. public_hostname() {
  19. addcode up 9 5 "hostname $1"
  20. }
  21. public_domainname() {
  22. # THIS IS A HACK
  23. addcode up 9 5 "sed 's/`hostname`\..* /`hostname`.$1 /' /etc/hosts > \
  24. /etc/hosts.new ; mv /etc/hosts{.new,}"
  25. }