#!/bin/sh
#
# This script is a component of Warewulf,
# http://www.runlevelzero.net/greg/warewulf
#
#########################################################################
#
# Copyright (c) 2003, The Regents of the University of California,
# through
# Lawrence Berkeley National Laboratory (subject to receipt of any
# required approvals from the U.S. Dept. of Energy).  All rights
# reserved.
#
# This program 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.
#
# This program 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.
#
# The GNU GPL Document can be found at:
# http://www.gnu.org/copyleft/gpl.html
#
#########################################################################
#
# Written and maintained by:
#       Greg Kurtzer, <gmkurtzer@lbl.gov>

# The purpose of this is to demonstrate how the sync_modules work. They need
# to create a directory, make files in that directory where you would want
# them placed on the real system, then return with an 'echo' of what directory
# you just wrote in. This will be called by wwnodes --sync for each of the
# node groups. Wwnodes will then automatically remove the directory that the 
# module created. 
#
# wwnodes will call on this script module with a single argument which
# indicates which node group it is currently working on.

SYNCDIR=`mktemp -d /tmp/XXXXXX`

mkdir -p $SYNCDIR/etc

echo "nodegroup:[$1]" > $SYNCDIR/etc/nodegroup

echo $SYNCDIR
