01-atm 773 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #!/bin/sh
  2. [ -x /usr/sbin/br2684ctl ] || exit 0
  3. [ "${IFACE%%[0-9]*}" = "nas" ] || exit 0
  4. [ "$IF_ATM_ENCAPS" ] || encap=0
  5. [ "$IF_ATM_PAYLOAD" ] || payload=1
  6. [ "$IF_ATM_VPI" ] || IF_ATM_VPI=1
  7. [ "$IF_ATM_VCI" ] || IF_ATM_VCI=32
  8. [ "$IF_ATM_PAYLOAD" ] && case "$IF_ATM_PAYLOAD" in
  9. bridged)
  10. payload=1
  11. ;;
  12. routed)
  13. payload=0
  14. ;;
  15. *)
  16. echo "Wrong payload, use either bridged or routed"
  17. exit 1
  18. ;;
  19. esac
  20. [ "$IF_ATM_ENCAPS" ] && case "$IF_ATM_ENCAPS" in
  21. llc)
  22. encap=0
  23. ;;
  24. vc)
  25. encap=1
  26. ;;
  27. *)
  28. echo "Wrong Encapsulation use either llc or vc"
  29. exit 1
  30. ;;
  31. esac
  32. br2684ctl -b -c ${IFACE##*[a-z]} -e $encap -p $payload -a $IF_ATM_VPI.$IF_ATM_VCI
  33. ifconfig nas${IFACE##*[a-z]} up
  34. exit 0