Commit 63ca30d6 authored by Kroese's avatar Kroese Committed by GitHub
Browse files

Hide netcat output

parent 142b27f5
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -47,9 +47,13 @@ _graceful_shutdown() {
    if ((AGENT_VERSION > 1)); then

      # Send a NMI interrupt which will be detected by the kernel
      echo 'nmi' | nc -q 1 -w 1 localhost "${QEMU_MONPORT}" > /dev/null
      if ! echo 'nmi' | nc -q 1 -w 1 localhost "${QEMU_MONPORT}" > /dev/null ; then
        AGENT_VERSION=0
      fi

    fi
    
    else
    if ((AGENT_VERSION < 2)); then

      echo && echo "Please update the VirtualDSM Agent to allow for gracefull shutdowns..."

@@ -65,7 +69,7 @@ _graceful_shutdown() {
    echo $(($(cat ${_QEMU_SHUTDOWN_COUNTER})+1)) > ${_QEMU_SHUTDOWN_COUNTER}

    # Try to connect to qemu
    if echo 'info version'| nc -q 1 -w 1 localhost "${QEMU_MONPORT}" > /dev/null; then
    if echo 'info version'| nc -q 1 -w 1 localhost "${QEMU_MONPORT}" >/dev/null 2>&1 ; then

      sleep 1
      #echo "Shutting down, waiting... ($(cat ${_QEMU_SHUTDOWN_COUNTER})/${QEMU_POWERDOWN_TIMEOUT})"
@@ -75,7 +79,7 @@ _graceful_shutdown() {
  done

  echo && echo "Quitting..."
  echo 'quit' | nc -q 1 -w 1 localhost "${QEMU_MONPORT}" > /dev/null || true
  echo 'quit' | nc -q 1 -w 1 localhost "${QEMU_MONPORT}" >/dev/null 2>&1 || true

  return
}