Skip to content

Commit

Permalink
refactor: display socket hints based on what tools are available
Browse files Browse the repository at this point in the history
  • Loading branch information
flexiondotorg committed Jul 4, 2024
1 parent 0b1dbb4 commit 4a023b1
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions quickemu
Original file line number Diff line number Diff line change
Expand Up @@ -1463,8 +1463,11 @@ function vm_boot() {
elif [ "${monitor}" == "socket" ]; then
# shellcheck disable=SC2054,SC2206
args+=(-monitor unix:${SOCKET_MONITOR},server,nowait)
echo " - Monitor: On host: nc -U \"${SOCKET_MONITOR}\""
echo " or : socat -,echo=0,icanon=0 unix-connect:${SOCKET_MONITOR}"
if command -v socat &>/dev/null; then
echo " - Monitor: On host: socat -,echo=0,icanon=0 unix-connect:${SOCKET_MONITOR}"
elif command -v nc &>/dev/null; then
echo " - Monitor: On host: nc -U \"${SOCKET_MONITOR}\""
fi
else
echo "ERROR! \"${monitor}\" is an unknown monitor option."
exit 1
Expand All @@ -1488,8 +1491,11 @@ function vm_boot() {
elif [ "${serial}" == "socket" ]; then
# shellcheck disable=SC2054,SC2206
args+=(-serial unix:${SOCKET_SERIAL},server,nowait)
echo " - Serial: On host: nc -U \"${SOCKET_SERIAL}\""
echo " or : socat -,echo=0,icanon=0 unix-connect:${SOCKET_SERIAL}"
if command -v socat &>/dev/null; then
echo " - Serial: On host: socat -,echo=0,icanon=0 unix-connect:${SOCKET_SERIAL}"
elif command -v nc &>/dev/null; then
echo " - Serial: On host: nc -U \"${SOCKET_SERIAL}\""
fi
else
echo "ERROR! \"${serial}\" is an unknown serial option."
exit 1
Expand Down

0 comments on commit 4a023b1

Please sign in to comment.