From: Ken Raeburn Date: Sat, 13 May 2006 06:21:09 +0000 (+0000) Subject: Have Tcl script error out if initialization fails X-Git-Tag: krb5-1.5-alpha1~25 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a451dd6ccd3041c7981cfabdf5f822752fcdecdd;p=krb5.git Have Tcl script error out if initialization fails git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@18006 dc483132-0cff-0310-8789-dd5450dbe970 --- 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=$?