- [ -z "${xtse_adsl}" ] && xtse_adsl=$xtse_adsl_b
-
- eval "tone_adsl=\"\${tone_adsl_$tone}\""
- [ -z "${tone_adsl}" ] && tone_adsl=$tone_adsl_av
-
- eval "tone_vdsl=\"\${tone_vdsl_$tone}\""
- [ -z "${tone_vdsl}" ] && tone_vdsl=$tone_vdsl_av
-
- [ -z "${firmware}" ] && firmware=vdsl.bin
-
- xdsl_scr adsl "${xtse_adsl}"
- xdsl_scr vdsl "${xtse_vdsl}"
- lowlevel_cfg "${tone_adsl}" "${tone_vdsl}"
-
- service_start /sbin/vdsl_cpe_control \
- -i `echo $xtse_adsl | sed "s/ /_/g"` \
+ if [ "${xtse_adsl}" ]; then
+ xtse=$xtse_adsl
+ else
+ xtse=$xtse_vdsl
+ fi
+
+ [ -z "${firmware}" ] && firmware=/lib/firmware/vdsl.bin
+ [ -f "${firmware}" ] || {
+ echo failed to find $firmware
+ return 1
+ }
+
+ procd_open_instance
+ procd_set_param command /sbin/vdsl_cpe_control_wrapper \
+ -i`echo $xtse | sed "s/ /_/g"` \