dsl_control 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #!/bin/sh /etc/rc.common
  2. # Copyright (C) 2012 OpenWrt.org
  3. START=99
  4. EXTRA_COMMANDS="status lucistat"
  5. EXTRA_HELP=" status Get DSL status information
  6. lucistat Get status information if lua friendly format"
  7. SERVICE_DAEMONIZE=1
  8. SERVICE_WRITE_PID=1
  9. [ -f /lib/functions/lantiq_dsl.sh ] && . /lib/functions/lantiq_dsl.sh
  10. annex_b=10_00_10_00_00_04_00_00
  11. annex_bdmt=10_00_00_00_00_00_00_00
  12. annex_b2=00_00_10_00_00_00_00_00
  13. annex_b2p=00_00_00_00_00_04_00_00
  14. annex_a=04_01_04_00_00_01_00_00
  15. annex_at1=01_00_00_00_00_00_00_00
  16. annex_alite=00_01_00_00_00_00_00_00
  17. annex_admt=04_00_00_00_00_00_00_00
  18. annex_a2=00_00_04_00_00_00_00_00
  19. annex_a2p=00_00_00_00_00_01_00_00
  20. annex_l=00_00_00_00_04_00_00_00
  21. annex_m=00_00_00_00_40_00_04_00
  22. annex_m2=00_00_00_00_40_00_00_00
  23. annex_m2p=00_00_00_00_00_00_04_00
  24. start() {
  25. local annex
  26. local firmware
  27. local xtu
  28. config_load network
  29. config_get annex dsl annex
  30. config_get firmware dsl firmware
  31. eval "xtu=\"\${annex_$annex}\""
  32. [ -z "${firmware}" ] &&
  33. firmware=/lib/firmware/adsl.bin
  34. [ -f "${firmware}" ] || {
  35. echo failed to find $firmware
  36. return 1
  37. }
  38. service_start /sbin/dsl_cpe_control -i${xtu} \
  39. -n /sbin/dsl_notify.sh \
  40. -f ${firmware}
  41. }
  42. stop() {
  43. DSL_NOTIFICATION_TYPE="DSL_INTERFACE_STATUS" \
  44. DSL_INTERFACE_STATUS="DOWN" \
  45. /sbin/dsl_notify.sh
  46. service_stop /sbin/dsl_cpe_control
  47. }