Roger Luethi b1cdd3679a labs: set errexit and no nounset for client scripts
Use bash options to have client scripts exit with an error if any
command returns an error (errexit) or if an unset variable is used
(nounset).

Fix those scripts that would otherwise fail due to this change.

Change-Id: I23336bcb5227e884eaf6dd6e9eb5cb0fc24977cc
2014-09-29 08:15:28 +02:00

15 lines
328 B
Bash
Executable File

#!/usr/bin/env bash
set -o errexit -o nounset
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'