
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
15 lines
366 B
Bash
Executable File
15 lines
366 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
|
|
|
|
echo "Shutting down"
|
|
|
|
# Shutdown some time after returning so our caller has time to finish
|
|
sudo -b sh -c 'sleep 2; systemctl poweroff'
|