[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] Added trap for ERR, to get better response from the scripts when they are really



# HG changeset patch
# User emellor@xxxxxxxxxxxxxxxxxxxxxx
# Node ID 28331cd6d43af74209f48c00e6581b3e86c2c014
# Parent  e67cfb40411db6b7350fdb7567783aa412235c97
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@xxxxxxxxxxxxx>

diff -r e67cfb40411d -r 28331cd6d43a tools/examples/xen-hotplug-common.sh
--- a/tools/examples/xen-hotplug-common.sh      Tue Nov 29 14:56:16 2005
+++ b/tools/examples/xen-hotplug-common.sh      Tue Nov 29 14:56:54 2005
@@ -40,6 +40,17 @@
   xenstore_write "$XENBUS_PATH"/hotplug-status connected
 }
 
+do_or_die() {
+  "$@" || fatal "$@ failed"
+}
+
+sigerr() {
+  fatal "$0" "$@" "failed; error detected."
+}
+
+trap sigerr ERR
+
+
 ##
 # xenstore_read <path>+
 #

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.