Skip to content

Commit

Permalink
eve tool: replace wget with nc
Browse files Browse the repository at this point in the history
in order to keep the image small and reduce the attack surface
wget may be removed in the future, so instead use nc

Signed-off-by: Christoph Ostarek <christoph@zededa.com>
  • Loading branch information
christoph-zededa committed Jun 7, 2023
1 parent 8c92fe4 commit 83f3bec
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/dom0-ztools/rootfs/bin/eve
Original file line number Diff line number Diff line change
Expand Up @@ -98,19 +98,19 @@ http_debug_request() {
pkill -USR2 /opt/zededa/bin/zedbox
fi

wget -O - "$URL" --post-data ''
printf "POST $URL HTTP/1.0\r\n\r\n" | nc 127.1 6543

This comment has been minimized.

Copy link
@eriknordmark

eriknordmark Jun 12, 2023

Contributor

Note shellcheck complaints in this file

This comment has been minimized.


if [ "$running" = "0" ]; then
wget -O - 127.1:6543/stop --post-data '' > /dev/null 2>&1
printf "POST /stop HTTP/1.0\r\n\r\n" | nc 127.1 6543
fi
}

dump_stacks() {
http_debug_request "127.1:6543/dump/stacks"
http_debug_request "/dump/stacks"
}

dump_mem() {
http_debug_request "127.1:6543/dump/memory"
http_debug_request "/dump/memory"
}

case "$1" in
Expand Down Expand Up @@ -180,7 +180,7 @@ __EOT__
echo "Use ssh -L6543:localhost:6543 root@... to forward the http port"
echo "Visit http://localhost:6543 with your browser"
elif [ "$2" = "stop" ]; then
wget -O - 127.1:6543/stop --post-data '' > /dev/null 2>&1
printf "POST /stop HTTP/1.0\r\n\r\n" | nc 127.1 6543
else
echo "Unknown command; use 'start' or 'stop'"
fi
Expand Down

0 comments on commit 83f3bec

Please sign in to comment.