If I execute this below lines on proxmox shell to wakeup my mac os it works flawlessly but in shell script (.sh) it doesn't work
qm monitor 503
system_wakeup
quit
I tried this code which is posted as solution in another question but it throws an error "2022/02/19 12:02:58 socat[6449] E connect(5, AF=1 "/var/run/qemu-server/503.mon", 30): No such file or directory"
#!/bin/bash
QEMU_MONITOR_SOCKET_PATH=/var/run/qemu-server
QEMU_MONITOR_SOCKET_EXT=mon
SOCAT=$(which socat) || { echo "socat cmd not found => exit"; exit 1; }
VMID=503
command="command you want to run in qemu monitor"
echo "${command}" | ${SOCAT} unix-connect:${QEMU_MONITOR_SOCKET_PATH}/${VMID}.${QEMU_MONITOR_SOCKET_EXT} stdio
exit 0
qm monitor 503
system_wakeup
quit
I tried this code which is posted as solution in another question but it throws an error "2022/02/19 12:02:58 socat[6449] E connect(5, AF=1 "/var/run/qemu-server/503.mon", 30): No such file or directory"
#!/bin/bash
QEMU_MONITOR_SOCKET_PATH=/var/run/qemu-server
QEMU_MONITOR_SOCKET_EXT=mon
SOCAT=$(which socat) || { echo "socat cmd not found => exit"; exit 1; }
VMID=503
command="command you want to run in qemu monitor"
echo "${command}" | ${SOCAT} unix-connect:${QEMU_MONITOR_SOCKET_PATH}/${VMID}.${QEMU_MONITOR_SOCKET_EXT} stdio
exit 0