Shell script for propagating the Kerberos database to slave servers
authorTheodore Tso <tytso@mit.edu>
Fri, 3 Mar 1995 23:16:06 +0000 (23:16 +0000)
committerTheodore Tso <tytso@mit.edu>
Fri, 3 Mar 1995 23:16:06 +0000 (23:16 +0000)
(Still needs some work, but that's OK.)

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5073 dc483132-0cff-0310-8789-dd5450dbe970

src/slave/kslave_update [new file with mode: 0644]

diff --git a/src/slave/kslave_update b/src/slave/kslave_update
new file mode 100644 (file)
index 0000000..d6207de
--- /dev/null
@@ -0,0 +1,30 @@
+#!/bin/sh
+#
+# Propagate if database (principal.pag) has been modified since last dump
+# (dumpfile.dump_ok) or if database has been dumped since last successful
+# propagation (dumpfile.<slave machine>.last_prop)
+
+KDB_DIR=/krb5
+
+KDB_FILE=$KDB_DIR/principal.page
+DUMPFILE=$KDB_DIR/slave_datatrans
+KDB5_EDIT=/krb5/sbin/kdb5_edit
+KPROP=/krb5/sbin/kprop
+SLAVE=$1
+if [ -z "${SLAVE}" ]
+then 
+  echo "Usage $0 slave_server"
+fi
+
+if [ "`ls -t $DUMPFILE.dump_ok $KDB_FILE | sed -n 1p`"  = "$KDB_FILE" -o \
+     "`ls -t $DUMPFILE.${SLAVE}.last_prop $DUMPFILE.dump_ok | \
+               sed -n 1p`"  = "$DUMPFILE.dump_ok" ]
+then
+
+       date
+       $KDB5_EDIT -R "ddb $DUMPFILE" >/dev/null
+
+       $KPROP -d -f $DUMPFILE ${SLAVE}
+       rm $DUMPFILE
+fi