directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: r122682 - /incubator/directory/kerberos/trunk/bin /incubator/directory/kerberos/trunk/bin/kerberos.sh
Date Fri, 17 Dec 2004 21:30:18 GMT
Author: erodriguez
Date: Fri Dec 17 13:30:16 2004
New Revision: 122682

URL: http://svn.apache.org/viewcvs?view=rev&rev=122682
Log:
Shell script for starting/stopping Kerberos server.
Added:
   incubator/directory/kerberos/trunk/bin/
   incubator/directory/kerberos/trunk/bin/kerberos.sh   (contents, props changed)

Added: incubator/directory/kerberos/trunk/bin/kerberos.sh
Url: http://svn.apache.org/viewcvs/incubator/directory/kerberos/trunk/bin/kerberos.sh?view=auto&rev=122682
==============================================================================
--- (empty file)
+++ incubator/directory/kerberos/trunk/bin/kerberos.sh	Fri Dec 17 13:30:16 2004
@@ -0,0 +1,70 @@
+#!/bin/sh
+#
+# The Kerberos command script
+#
+# Environment Variables
+#
+#   KERBEROS_JAVA_HOME The java implementation to use.  Default is
+#                      assumed to be located at /usr/bin/java.
+#
+#   KERBEROS_HOME      The path that the KERBEROS server is to be run
+#                      within. Default is the parent directory.
+#
+#   KERBEROS_LIB       The path containing the Java archives.
+#
+
+THIS="$0"
+
+while [ -h "$THIS" ]; do
+  ls=`ls -ld "$THIS"`
+  LINK=`expr "$ls" : '.*-> \(.*\)$'`
+  if expr "$LINK" : '.*/.*' > /dev/null; then
+    THIS="$LINK"
+  else
+    THIS=`dirname "$THIS"`/"$LINK"
+  fi
+done
+
+if [ "$KERBEROS_HOME" = '' ] ; then
+   THIS_DIR=`dirname "$THIS"`
+   KERBEROS_HOME=`cd "$THIS_DIR/.." ; pwd`
+fi
+
+cd $KERBEROS_HOME
+
+if [ "$KERBEROS_LIB" = '' ] ; then
+   KERBEROS_LIB="$KERBEROS_HOME/lib"
+fi
+
+for JAR in `ls $KERBEROS_LIB/*.jar`; do
+   if [ "$CLASS_PATH" != '' ] ; then
+      CLASS_PATH="$CLASS_PATH:$JAR"
+   elif [ "$JAR" != '' ] ; then
+      CLASS_PATH="$KERBEROS_LIB:$JAR"
+   fi
+done
+
+if [ "$KERBEROS_JAVA_HOME" = '' ] ; then
+   if [ "$JAVA_HOME" = '' ] ; then
+      KERBEROS_JAVA_HOME='/usr'
+   else
+      KERBEROS_JAVA_HOME="$JAVA_HOME"
+   fi
+fi
+
+case "$1" in
+   start)
+      if [ -f "$KERBEROS_JAVA_HOME/bin/java" ] ; then
+         $KERBEROS_JAVA_HOME/bin/java -server -classpath $CLASS_PATH -Dserver.properties=server.properties
org.apache.kerberos.kdc.server.udp.Main > /dev/null 2>&1 &
+      fi
+   ;;
+   stop)
+      if [ -f /usr/bin/pkill ] ; then
+         /usr/bin/pkill -f KERBEROS
+      fi 
+   ;;
+   *)
+   echo "Usage: $0 { start | stop }"
+esac
+exit 0
+

Mime
View raw message