Imported Upstream version 1.10.2
[platform/upstream/krb5.git] / src / kadmin / testing / scripts / stop_servers_local
1 #!/bin/sh
2
3 DUMMY=${TESTDIR=$TOP/testing}
4 DUMMY=${KRB5RCACHEDIR=$TESTDIR}
5
6 while [ $# -gt 0 ] ; do
7         case $1 in
8                 -start_servers)
9                         start_servers=$1
10                         ;;
11                 *) 
12                         TOP=$1
13                         export TOP
14                         ;;
15         esac
16         shift
17 done
18
19 # kill any running servers.
20
21 if $VERBOSE; then echo "Killing servers:"; fi
22
23 for pid in xxx \
24         `$PS_ALL | grep krb5kdc | grep -v grep | awk '{print $2}'` \
25         `$PS_ALL | grep kadmind | grep -v grep | awk '{print $2}'` \
26         ; do
27         case "$pid" in
28                 xxx)
29                         ;;
30                 *)
31                         if $VERBOSE; then $PS_PID$pid | grep -v COMMAND; fi
32                         kill $pid
33                         ;;
34         esac
35 done
36
37 # Destroy the kdc replay cache so we don't lose if we try to run the
38 # KDC as another unix user.
39 if test "x$USER" = x ; then
40   USER=$LOGNAME
41 fi
42 rm -f $KRB5RCACHEDIR/krb5kdc_rcache.$USER
43
44 exit 0