From: Theodore Tso Date: Fri, 3 Mar 1995 23:16:06 +0000 (+0000) Subject: Shell script for propagating the Kerberos database to slave servers X-Git-Tag: krb5-1.0-beta5~597 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=5cfb1cc45adde6bca4a5a9d264c29b1b938a4aad;p=krb5.git Shell script for propagating the Kerberos database to slave servers (Still needs some work, but that's OK.) git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5073 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/slave/kslave_update b/src/slave/kslave_update new file mode 100644 index 000000000..d6207de60 --- /dev/null +++ b/src/slave/kslave_update @@ -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..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