Merge "Scripts to clean disk and shut down"

This commit is contained in:
Jenkins 2014-06-18 08:29:49 +00:00 committed by Gerrit Code Review
commit 0f5e04eab0
2 changed files with 25 additions and 0 deletions

13
labs/scripts/shutdown.sh Normal file
View File

@ -0,0 +1,13 @@
#!/usr/bin/env bash
TOP_DIR=$(cd $(dirname "$0")/.. && pwd)
source "$TOP_DIR/config/paths"
source "$LIB_DIR/functions.guest"
indicate_current_auto
exec_logfile
echo "Shutting down"
# Shutdown some time after returning so our caller has time to finish
sudo -b sh -c 'sleep 2; /sbin/shutdown -P now'

View File

@ -0,0 +1,12 @@
#!/usr/bin/env bash
TOP_DIR=$(cd $(dirname "$0")/.. && pwd)
source "$TOP_DIR/config/paths"
source "$LIB_DIR/functions.guest"
indicate_current_auto
exec_logfile
# Fill unused disk space with zeroes (the disk image is easier to compress when
# it doesn't contain leftovers from deleted files)
zero_empty_space