Files
os-xenapi/tools/install/scripts/on_exit.sh
naichuans 85a588e382 os-xenapi: remove install dependence with devstack 2:
Part two: configure ubuntu DomU VM and introduce
install-devstack-xen.sh
Move tools/xen from devstack to os-xenapi which will be the center
place to hold some XenServer/XenAPI specify source code.

This part is used to configure a DomU VM and  install devstack on
domu VM

Change-Id: I20f4663d987266d6ff6d57c5eb3c4447d51f9162
2017-06-19 08:15:54 +00:00

25 lines
355 B
Bash
Executable File

#!/bin/bash
set -e
set -o xtrace
if [ -z "${on_exit_hooks:-}" ]; then
on_exit_hooks=()
fi
on_exit()
{
for i in $(seq $((${#on_exit_hooks[*]} - 1)) -1 0); do
eval "${on_exit_hooks[$i]}"
done
}
add_on_exit()
{
local n=${#on_exit_hooks[*]}
on_exit_hooks[$n]="$*"
if [[ $n -eq 0 ]]; then
trap on_exit EXIT
fi
}