File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
packages/ns-phonehome/files Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -15,17 +15,24 @@ if [ "$ENABLED" = "0" ] || [ -z "$URL" ]; then
1515 exit 0
1616fi
1717
18- /usr/sbin/phonehome | curl -m 180 --retry 3 -L -s \
18+ TMPFILE=$( mktemp) || exit 1
19+
20+ /usr/sbin/phonehome > " $TMPFILE "
21+
22+ curl -m 180 --retry 3 -L -s \
1923 -H " Content-type: application/json" -H " Accept: application/json" \
20- --data-binary @- " $URL " > /dev/null
24+ --data-binary @" $TMPFILE " " $URL " > /dev/null
2125
2226# Temporary send data to new endpoint
2327# To be removed when the migration to new my.nethesis.it will be completed
2428if [ " $TYPE " == " enterprise" ]; then
2529 SYSTEM_ID=$( uci -q get ns-plug.config.system_id)
2630 SYSTEM_SECRET=$( uci -q get ns-plug.config.secret)
27- /usr/sbin/phonehome | /usr/ bin/curl -m 180 --retry 3 -L -s --user " $SYSTEM_ID :$SYSTEM_SECRET " \
31+ /usr/bin/curl -m 180 --retry 3 -L -s --user " $SYSTEM_ID :$SYSTEM_SECRET " \
2832 -H " Content-Type: application/json" \
29- --data-binary @- https://my.nethesis.it/proxy/inventory > /dev/null
33+ --data-binary @" $TMPFILE " https://my.nethesis.it/proxy/inventory > /dev/null
34+ rm -f " $TMPFILE "
3035 exit 0
3136fi
37+
38+ rm -f " $TMPFILE "
You can’t perform that action at this time.
0 commit comments