Rev 477: fixed error handling in event scripts in http://samba.org/~tridge/ctdb

tridge at samba.org tridge at samba.org
Wed Jun 6 01:27:06 GMT 2007


------------------------------------------------------------
revno: 477
revision-id: tridge at samba.org-20070606012706-wlzgtpwgr0hfrifu
parent: tridge at samba.org-20070606011324-nse5zhhtb8xalu59
committer: Andrew Tridgell <tridge at samba.org>
branch nick: tridge
timestamp: Wed 2007-06-06 11:27:06 +1000
message:
  fixed error handling in event scripts
modified:
  config/events                  events-20070529030121-04fjh63cxfh8v1pj-1
=== modified file 'config/events'
--- a/config/events	2007-06-04 13:54:46 +0000
+++ b/config/events	2007-06-06 01:27:06 +0000
@@ -39,8 +39,8 @@
 # call all application or local scripts
 [ -d /etc/ctdb/events.d ] && {
     # only accept scripts of the form NN.name
-    /bin/ls /etc/ctdb/events.d | /bin/grep '^[0-9]*\.\w*$' | sort -n |
-    while read SCRIPT; do
+    scripts=`/bin/ls /etc/ctdb/events.d | /bin/grep '^[0-9]*\.\w*$' | sort -n`
+    for SCRIPT in $scripts; do
 	[ -x /etc/ctdb/events.d/$SCRIPT ] && {
 	    /etc/ctdb/events.d/$SCRIPT $cmd "$1" "$2" "$3" || exit 1
 	}



More information about the samba-cvs mailing list