3 # Copyright (C) 2011 Google Inc.
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
28 "$SOCAT" STDIO "UNIX-CONNECT:$MONITOR" 2>/dev/null |
29 grep -q '^VM status: paused' || return
30 # As there is no way to be sure when the main socat has actually connected to
31 # the instance console, sleep for a few seconds before unpausing the
32 # instance. This is a tradeoff between missing some console output if the
33 # node is overloaded and making the user wait everytime when the node isn't
36 # Send \r\n after notice as terminal is in raw mode
37 printf "Instance $INSTANCE is paused, unpausing\r\n"
38 echo "c" | "$SOCAT" STDIO "UNIX-CONNECT:$MONITOR" &>/dev/null
42 "$SOCAT" "$PARAMS" "$CONSOLE"