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.4 KiB

  1. #!/bin/sh
  2. # --- T2-COPYRIGHT-NOTE-BEGIN ---
  3. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. #
  5. # T2 SDE: package/.../udhcp/t2-default.script
  6. # Copyright (C) 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. # --- T2-COPYRIGHT-NOTE-END ---
  15. case "$1" in
  16. deconfig)
  17. ip link set $interface up
  18. ip addr flush dev $interface
  19. ;;
  20. bound)
  21. netmask=`ipnm2nwbc -v $ip $subnet | grep "^Network" | cut -d'/' -f2 | tr -d ' '`
  22. ip addr add $ip/$netmask dev $interface
  23. for x in $router; do
  24. ip route add default via $x dev $interface
  25. done
  26. if [ "$UPDATE_RESOLVCONF" != 0 ]; then
  27. touch /etc/resolv.conf
  28. if [ "$domain" ]; then
  29. grep -v "^domain" /etc/resolv.conf > /tmp/resolv.conf.$$
  30. echo "domain $domain" >> /tmp/resolv.conf.$$
  31. cat /tmp/resolv.conf.$$ > /etc/resolv.conf
  32. fi
  33. if [ "$dns" ]; then
  34. grep -v "^nameserver" /etc/resolv.conf > /tmp/resolv.conf.$$
  35. for x in $dns; do
  36. echo "nameserver $x" >> /tmp/resolv.conf.$$
  37. done
  38. cat /tmp/resolv.conf.$$ > /etc/resolv.conf
  39. fi
  40. rm -f /tmp/resolv.conf.$$
  41. fi
  42. ;;
  43. *)
  44. echo "Unknown method $1"
  45. exit 2 ;;
  46. esac