Bash 脚本删除所有快照
#!/bin/bash
NO_SNAPSHOTS="No snapshots have been taken yet"
SNAPSHOT_OUTPUT=$(vagrant snapshot list | grep "${NO_SNAPSHOTS}")
if [ -z "${SNAPSHOT_OUTPUT}" ]; then
echo "Found some snapshots, going to remove them"
for SNAPSHOT in $(vagrant snapshot list); do
vagrant snapshot delete "${SNAPSHOT}"
done
else
echo "No snapshots found"
fi