#!/bin/sh
################################################################################
# $Id: sync_passwd 12 2005-12-07 17:55:51Z makia $
################################################################################
#  Copyright (C) 2004 The Regents of the University of California.
#  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
#  Written by Makia Minich <makia@llnl.gov>
#  UCRL-CODE-155916
#  
#  This file is part of GeDI, a diskless image management tool.
#  For details, see <http://www.llnl.gov/linux/gedi/>.
#  
#  GeDI is free software; you can redistribute it and/or modify it under
#  the terms of the GNU General Public License as published by the Free
#  Software Foundation; either version 2 of the License, or (at your option)
#  any later version.
#  
#  GeDI is distributed in the hope that it will be useful, but WITHOUT ANY
#  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
#  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
#  details.
#  
#  You should have received a copy of the GNU General Public License along
#  with GeDI; if not, write to the Free Software Foundation, Inc.,
#  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.
################################################################################
#
# Sync up the password files for use on the clients.

. /etc/gedi/variables

SERVER_ETC="/etc"

for NFSROOT in ${IMAGE}/* ; do
   if [ -d "${NFSROOT}/etc" ] ; then
      /bin/cp -pb ${SERVER_ETC}/passwd  ${NFSROOT}/etc/passwd
      /bin/cp -pb ${SERVER_ETC}/shadow  ${NFSROOT}/etc/shadow
      /bin/cp -pb ${SERVER_ETC}/group   ${NFSROOT}/etc/group
      /bin/cp -pb ${SERVER_ETC}/gshadow ${NFSROOT}/etc/gshadow
   fi
done
