From 4e82190d88f73494dbc6d261e6eb507e348e10e3 Mon Sep 17 00:00:00 2001 From: vdutta Date: Tue, 17 Jan 2023 16:07:26 +0530 Subject: [PATCH] Fix upload error with extra header --- scripts/upload | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/upload b/scripts/upload index 0115151d..835e9526 100755 --- a/scripts/upload +++ b/scripts/upload @@ -94,13 +94,13 @@ upload_launch() { rx_bytes_start=$(ubus call network.device status "{'name':'$device'}" | jsonfilter -e @.statistics.rx_bytes) time_start=$(date +"%s.282646") # It should be like that time_start=$(date +"%s.%6N") but since OpenWrt busybox has limitations and doesn't support nonoseconds so keep it hardcoded - res=$(dd if=/dev/zero bs=$bs count=$count 2>/dev/null | curl ${ip_proto} --fail --silent --max-time ${UPLOAD_TIMEOUT} -T - ${url} -w "${format}") + res=$(dd if=/dev/zero bs=$bs count=$count 2>/dev/null | curl ${ip_proto} --fail --silent --max-time ${UPLOAD_TIMEOUT} -T - ${url} -w "${format}"|grep -wo '{.*}') time_end=$(date +"%s.282646") # It should be like that time_end=$(date +"%s.%6N") but since OpenWrt busybox has limitations and doesn't support nonoseconds so keep it hardcoded tx_bytes_end=$(ubus call network.device status "{'name':'$device'}" | jsonfilter -e @.statistics.tx_bytes) rx_bytes_end=$(ubus call network.device status "{'name':'$device'}" | jsonfilter -e @.statistics.rx_bytes) - logger -t "bbf_upload" "########### ${url} ==> ${res} ###########" + logger -t "bbf_upload" "# ${url} => ${res} #" json_load "${res}" json_get_var size_upload size_upload json_get_var time_appconnect time_appconnect