OpenSDE Packages Database (without history before r20070)
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.

47 lines
1.2 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../rocknet/rocknet_dns.sh
  5. # Copyright (C) 2010 The OpenSDE Project
  6. # Copyright (C) 2004 - 2006 The T2 SDE Project
  7. #
  8. # More information can be found in the files COPYING and README.
  9. #
  10. # This program is free software; you can redistribute it and/or modify
  11. # it under the terms of the GNU General Public License as published by
  12. # the Free Software Foundation; version 2 of the License. A copy of the
  13. # GNU General Public License can be found in the file COPYING.
  14. # --- SDE-COPYRIGHT-NOTE-END ---
  15. dns_init() {
  16. if isfirst "dns"; then
  17. addcode up 4 1 "cat /dev/null > /etc/resolv.conf"
  18. fi
  19. }
  20. public_nameserver() {
  21. local x=
  22. for x; do
  23. addcode up 4 5 "echo nameserver $x >> /etc/resolv.conf"
  24. done
  25. dns_init
  26. }
  27. public_search() {
  28. if ! isfirst "dns_search"; then
  29. error "Keyword >>search<< not allowed multiple times."
  30. return
  31. fi
  32. addcode up 4 4 "echo search $* >> /etc/resolv.conf"
  33. dns_init
  34. }
  35. public_hostname() {
  36. addcode up 9 5 "hostname $1"
  37. }
  38. public_domainname() {
  39. # THIS IS (still) A HACK
  40. addcode up 9 5 "sed -i 's/`hostname`\..* /`hostname`.$1 /' /etc/hosts"
  41. }