mirror of
https://github.com/vdsm/virtual-dsm.git
synced 2025-02-24 05:20:02 +08:00
Hide netcat output
This commit is contained in:
parent
142b27f529
commit
63ca30d62d
12
run/power.sh
12
run/power.sh
@ -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
|
||||
|
||||
else
|
||||
fi
|
||||
|
||||
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
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user