XenAPI: Fix declare definition

Some versions of bash do not initialise a variable with declare -a
therefore with set -u bash can terminate the script.

Be more verbose in declaring the array if it is not set

Change-Id: I6ec2b6e986aeffe539a2ab93432fa7af9e5a4f5d
This commit is contained in:
Bob Ball 2014-07-29 13:40:57 +01:00
parent 5c64a463d8
commit 5fb83a0a33

View File

@ -3,7 +3,9 @@
set -e
set -o xtrace
declare -a on_exit_hooks
if [ -z "${on_exit_hooks:-}" ]; then
on_exit_hooks=()
fi
on_exit()
{