File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
openwisp-monitoring/files Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -151,9 +151,7 @@ send_data() {
151151 fi
152152 filename=" $TMP_DIR /$filename "
153153 # check if the data file exist
154- if [ -f " $filename " ]; then
155- data=$( cat " $filename " )
156- else
154+ if ! [ -f " $filename " ]; then
157155 [ " $VERBOSE_MODE " -eq " 1" ] && logger -s " data file $filename not found." \
158156 -p daemon.info
159157 continue
@@ -176,7 +174,7 @@ send_data() {
176174 break
177175 fi
178176 # send data
179- response_code=$( $CURL_COMMAND -H " Content-Type: application/json" -d " $data " " $url " )
177+ response_code=$( $CURL_COMMAND -H " Content-Type: application/json" -d " @ $filename " " $url " )
180178 if [ " $response_code " = " 200" ]; then
181179 success=$(( success + 1 ))
182180 if [ " $VERBOSE_MODE " -eq " 1" ]; then
You can’t perform that action at this time.
0 commit comments