From a451dd6ccd3041c7981cfabdf5f822752fcdecdd Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Sat, 13 May 2006 06:21:09 +0000 Subject: [PATCH] Have Tcl script error out if initialization fails git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@18006 dc483132-0cff-0310-8789-dd5450dbe970 --- .../testing/scripts/start_servers_local | 22 ++++++++++++------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/kadmin/testing/scripts/start_servers_local b/src/kadmin/testing/scripts/start_servers_local index 37f438a25..b787b57e3 100755 --- a/src/kadmin/testing/scripts/start_servers_local +++ b/src/kadmin/testing/scripts/start_servers_local @@ -93,14 +93,20 @@ hostname=`hostname` QUALNAME=`$TOP/testing/scripts/qualname.pl $hostname`; export QUALNAME cat - > /tmp/start_servers_local$$ <<\EOF -source $env(STOP)/testing/tcl/util.t -set r $env(REALM) -set q $env(QUALNAME) -puts stdout [ovsec_kadm_init $env(SRVTCL) mrroot null $r \ - $OVSEC_KADM_STRUCT_VERSION $OVSEC_KADM_API_VERSION_1 server_handle] -puts stdout [ovsec_kadm_create_principal $server_handle \ - [simple_principal host/$q@$r] {OVSEC_KADM_PRINCIPAL} notathena] -puts stdout [ovsec_kadm_destroy $server_handle] +if { [catch { + source $env(STOP)/testing/tcl/util.t + set r $env(REALM) + set q $env(QUALNAME) + puts stdout [ovsec_kadm_init $env(SRVTCL) mrroot null $r \ + $OVSEC_KADM_STRUCT_VERSION $OVSEC_KADM_API_VERSION_1 server_handle] + puts stdout [ovsec_kadm_create_principal $server_handle \ + [simple_principal host/$q@$r] {OVSEC_KADM_PRINCIPAL} notathena] + puts stdout [ovsec_kadm_destroy $server_handle] +} err]} { + puts stderr "initialization error: $err" + exit 1 +} +exit 0 EOF eval "$SRVTCL < /tmp/start_servers_local$$ $REDIRECT" x=$? -- 2.26.2