Files
training-labs/labs/osbash/scripts/zero_empty.sh
Roger Luethi 74765e0858 Silence error message
In most cases, the check for a TOP_DIR file finds nothing (which is
perfectly fine), resulting in a confusing error message "cat:
../TOP_DIR: No such file or directory" at the top of the log files.

This patch removes the error message by redirecting the output for the
command to /dev/null.

Change-Id: Ifd771621b584c429c211a4c6aaab7d92f981cb72
2017-11-08 08:56:47 +01:00

14 lines
378 B
Bash
Executable File

#!/usr/bin/env bash
set -o errexit -o nounset
TOP_DIR=$(cd $(cat "../TOP_DIR" 2>/dev/null||echo $(dirname "$0"))/.. && pwd)
source "$TOP_DIR/config/paths"
source "$LIB_DIR/functions.guest.sh"
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