View Issue Details

IDProjectCategoryView StatusLast Update
0000428easycwmpQuestionpublic2021-04-29 04:57
Reporterjackson.stone Assigned To 
PriorityhighSeverityfeatureReproducibilityalways
Status newResolutionopen 
Summary0000428: Cannot debug ext\openwrt\scripts\functions\tr181\wifi functions
DescriptionI am trying to debug wifi_radio_get_FrequencyBands function in wifi script.
I add the "sh -x" and "sh +x" in the function like this:

wifi_radio_get_FrequencyBands() {
sh -x
        local phy="phy${1#*radio}"
        local freq=`iw phy $phy info | grep "MHz.*dBm" | head -1 | awk '{print $2}'`
sh +x
        [ "${freq#24}" = "$freq" ] && echo "5GHz" || echo "2.4GHz"

}

But I can't get any output by this command "easycwmp get Device.WiFi.Radio.1.OperatingFrequencyBand"

root@LEDE:/usr/share/easycwmp/functions# easycwmp get Device.WiFi.Radio.1.OperatingFrequencyBand


If I remove the "sh -x" and "sh +x" from the function, I can get below output.

root@LEDE:/usr/share/easycwmp/functions# easycwmp get Device.WiFi.Radio.1.Operat
ingFrequencyBand
{ "parameter": "Device.WiFi.Radio.1.OperatingFrequencyBand", "value": "5GHz" }
root@LEDE:/usr/share/easycwmp/functions#

Would you help to guide me how to debug shell script functions?

Thanks.

Jackson
TagsNo tags attached.
e-mail notification

Activities

There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2021-04-29 04:57 jackson.stone New Issue