diff options
Diffstat (limited to 'usr.sbin/ypserv/ypinit/ypinit.sh')
-rw-r--r-- | usr.sbin/ypserv/ypinit/ypinit.sh | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/usr.sbin/ypserv/ypinit/ypinit.sh b/usr.sbin/ypserv/ypinit/ypinit.sh index 5e7ec963264..b5d67333bbc 100644 --- a/usr.sbin/ypserv/ypinit/ypinit.sh +++ b/usr.sbin/ypserv/ypinit/ypinit.sh @@ -1,5 +1,5 @@ #!/bin/sh -# $Id: ypinit.sh,v 1.2 1995/11/08 00:01:05 deraadt Exp $ +# $Id: ypinit.sh,v 1.3 1996/03/02 03:01:40 dm Exp $ # # ypinit.sh - setup an master or slave server. # @@ -44,8 +44,8 @@ if [ $# -eq 3 ] then if [ $1 = "-s" ] # ypinit -s master_server domainname then - DOMAIN=`${3}` - SERVERTYPE=MASTER + DOMAIN=${3} + SERVERTYPE=SLAVE MASTER=${2} ERROR= fi @@ -63,15 +63,6 @@ a slave data base. master_server must be an existing reachable YP server." 1>&2 exit 1 fi -# Just allow master server for now! - -#if [ "${SERVERTYPE}" != "MASTER" ]; -#then -# echo "Sorry, only master server is implemented. Support for slave server" 1>&2 -# echo "needs support for map transfer which isn't implemented yet." 1>&2 -# exit 1 -#fi - # Check if domainname is set, don't accept an empty domainname if [ -z "${DOMAIN}" ] @@ -197,9 +188,12 @@ fi if [ "${SERVERTYPE}" = "SLAVE" ]; then - + + echo "" + for MAP in `${YPWHICH} -d ${DOMAIN} -m | cut -d\ -f1` do + echo "Transfering ${MAP}..." ${YPXFR} -h ${MASTER} -c -d ${DOMAIN} ${MAP} if [ $? -ne 0 ] @@ -208,4 +202,8 @@ then exit 1 fi done + + echo "" + echo "Don't forget to update map ypservers on ${MASTER}." + exit 0 fi |