ia64/xen-unstable

changeset 8122:28331cd6d43a

Added trap for ERR, to get better response from the scripts when they are really
broken, and add do_or_die command.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author emellor@leeni.uk.xensource.com
date Tue Nov 29 14:56:54 2005 +0000 (2005-11-29)
parents e67cfb40411d
children d1abced7ab7c
files tools/examples/xen-hotplug-common.sh
line diff
     1.1 --- a/tools/examples/xen-hotplug-common.sh	Tue Nov 29 14:56:16 2005 +0000
     1.2 +++ b/tools/examples/xen-hotplug-common.sh	Tue Nov 29 14:56:54 2005 +0000
     1.3 @@ -40,6 +40,17 @@ success() {
     1.4    xenstore_write "$XENBUS_PATH"/hotplug-status connected
     1.5  }
     1.6  
     1.7 +do_or_die() {
     1.8 +  "$@" || fatal "$@ failed"
     1.9 +}
    1.10 +
    1.11 +sigerr() {
    1.12 +  fatal "$0" "$@" "failed; error detected."
    1.13 +}
    1.14 +
    1.15 +trap sigerr ERR
    1.16 +
    1.17 +
    1.18  ##
    1.19  # xenstore_read <path>+
    1.20  #