refactor: make socket variable names consistent

This commit is contained in:
Martin Wimpress 2024-05-13 01:22:37 +01:00 committed by Martin Wimpress
parent bbc57c14e9
commit 90c373f0ab
1 changed files with 12 additions and 12 deletions

View File

@ -1223,9 +1223,9 @@ function vm_boot() {
fi fi
elif [ "${monitor}" == "socket" ]; then elif [ "${monitor}" == "socket" ]; then
# shellcheck disable=SC2054,SC2206 # shellcheck disable=SC2054,SC2206
args+=(-monitor unix:${VM_MONITOR_SOCKETPATH},server,nowait) args+=(-monitor unix:${SOCKET_MONITOR},server,nowait)
echo " - Monitor: On host: nc -U \"${VM_MONITOR_SOCKETPATH}\"" echo " - Monitor: On host: nc -U \"${SOCKET_MONITOR}\""
echo " or : socat -,echo=0,icanon=0 unix-connect:${VM_MONITOR_SOCKETPATH}" echo " or : socat -,echo=0,icanon=0 unix-connect:${SOCKET_MONITOR}"
else else
echo "ERROR! \"${monitor}\" is an unknown monitor option." echo "ERROR! \"${monitor}\" is an unknown monitor option."
exit 1 exit 1
@ -1253,9 +1253,9 @@ function vm_boot() {
fi fi
elif [ "${serial}" == "socket" ]; then elif [ "${serial}" == "socket" ]; then
# shellcheck disable=SC2054,SC2206 # shellcheck disable=SC2054,SC2206
args+=(-serial unix:${VM_SERIAL_SOCKETPATH},server,nowait) args+=(-serial unix:${SOCKET_SERIAL},server,nowait)
echo " - Serial: On host: nc -U \"${VM_SERIAL_SOCKETPATH}\"" echo " - Serial: On host: nc -U \"${SOCKET_SERIAL}\""
echo " or : socat -,echo=0,icanon=0 unix-connect:${VM_SERIAL_SOCKETPATH}" echo " or : socat -,echo=0,icanon=0 unix-connect:${SOCKET_SERIAL}"
else else
echo "ERROR! \"${serial}\" is an unknown serial option." echo "ERROR! \"${serial}\" is an unknown serial option."
exit 1 exit 1
@ -1476,7 +1476,7 @@ function monitor_send_cmd {
case "${monitor}" in case "${monitor}" in
socket) socket)
echo -e " - Sending: via socket ${MSG}" echo -e " - Sending: via socket ${MSG}"
echo -e "${MSG}" | socat -,shut-down unix-connect:"${VM_MONITOR_SOCKETPATH}" > /dev/null 2>&1;; echo -e "${MSG}" | socat -,shut-down unix-connect:"${SOCKET_MONITOR}" > /dev/null 2>&1;;
telnet) telnet)
echo -e " - Sending: via telnet ${MSG}" echo -e " - Sending: via telnet ${MSG}"
echo -e "${MSG}" | socat - tcp:"${monitor_telnet_host}":"${monitor_telnet_port}" > /dev/null 2>&1;; echo -e "${MSG}" | socat - tcp:"${monitor_telnet_host}":"${monitor_telnet_port}" > /dev/null 2>&1;;
@ -1540,21 +1540,21 @@ DELETE_DISK=0
DELETE_VM=0 DELETE_VM=0
FULLSCREEN="" FULLSCREEN=""
KILL_VM=0 KILL_VM=0
MONITOR_CMD=""
PUBLIC="" PUBLIC=""
PUBLIC_PERMS="" PUBLIC_PERMS=""
PUBLIC_TAG="" PUBLIC_TAG=""
SHORTCUT=0 SHORTCUT=0
SNAPSHOT_ACTION="" SNAPSHOT_ACTION=""
SNAPSHOT_TAG="" SNAPSHOT_TAG=""
SOCKET_MONITOR=""
SOCKET_SERIAL=""
STATUS_QUO="" STATUS_QUO=""
USB_PASSTHROUGH="" USB_PASSTHROUGH=""
VM="" VM=""
VMDIR="" VMDIR=""
VMNAME="" VMNAME=""
VMPATH="" VMPATH=""
MONITOR_CMD=""
VM_MONITOR_SOCKETPATH=""
VM_SERIAL_SOCKETPATH=""
# shellcheck disable=SC2155 # shellcheck disable=SC2155
readonly LAUNCHER=$(basename "${0}") readonly LAUNCHER=$(basename "${0}")
@ -1708,8 +1708,8 @@ if [ -n "${VM}" ] && [ -e "${VM}" ]; then
VMDIR=$(dirname "${disk_img}") VMDIR=$(dirname "${disk_img}")
VMNAME=$(basename "${VM}" .conf) VMNAME=$(basename "${VM}" .conf)
VMPATH=$(realpath "$(dirname "${VM}")") VMPATH=$(realpath "$(dirname "${VM}")")
VM_MONITOR_SOCKETPATH="${VMDIR}/${VMNAME}-monitor.socket" SOCKET_MONITOR="${VMDIR}/${VMNAME}-monitor.socket"
VM_SERIAL_SOCKETPATH="${VMDIR}/${VMNAME}-serial.socket" SOCKET_SERIAL="${VMDIR}/${VMNAME}-serial.socket"
if [ -z "${disk_img}" ]; then if [ -z "${disk_img}" ]; then
echo "ERROR! No disk_img defined." echo "ERROR! No disk_img defined."