aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/vm12
1 files changed, 11 insertions, 1 deletions
diff --git a/bin/vm b/bin/vm
index 75c1fc7..e1bb58f 100755
--- a/bin/vm
+++ b/bin/vm
@@ -255,7 +255,15 @@ case "$ACTION" in
else
STATUS=down
fi
- printf '%s\t%s\t%s\n' "$NAME" "$STATUS" "$PORTS"
+
+ SNAPSHOT="$(cat "$RUNDIR/$NAME.snapshot")"
+ if [ "$SNAPSHOT" = true ] && [ "$STATUS" = 'up' ]; then
+ SNAPSHOT='snapshot'
+ else
+ SNAPSHOT=''
+ fi
+
+ printf '%s\t%s\t%s\t%s\n' "$NAME" "$STATUS" "$PORTS" "$SNAPSHOT"
done
;;
up)
@@ -270,6 +278,7 @@ case "$ACTION" in
PID_F="$RUNDIR/$OS.pid"
SSH_PORT_F="$RUNDIR/$OS.ssh"
PORTMAPS_F="$RUNDIR/$OS.ports"
+ SNAPSHOT_F="$RUNDIR/$OS.snapshot"
if [ -e "$PID_F" ]; then
printf 'The VM for "%s" is already running with PID %s.\n' \
@@ -309,6 +318,7 @@ case "$ACTION" in
printf '%s' "$PID" > "$PID_F"
printf '%s' "$SSH_PORT" > "$SSH_PORT_F"
printf '%s' "$PORTMAPS" > "$PORTMAPS_F"
+ printf '%s' "$SNAPSHOT" > "$SNAPSHOT_F"
write_ssh_config
;;