#!/bin/sh listfile=$1 owner=$2 peersdir=$3 if [ -z "$listfile" -o -z "$owner" -o -z "$peersdir" ]; then echo "USAGE: $0 " echo " is a list containing lines of the format 'name' or 'name=lat lon'" echo " is a free text which will be embedded into the peers git" echo " is the path to the peers git's working copy" exit 1 fi if [ ! -r "$listfile" ]; then echo "The listfile is not readable (does it exist?)." exit 2 fi if [ ! -d "$peersdir" ]; then echo "The peers dir does not exist." exit 2 fi cat $listfile | while read line; do [ -z "$line" ] && continue name=`echo $line | cut -d"=" -f 1` latlon=`echo $line | cut -d"=" -f 2` echo "$name { $latlon }" ./configure-node.sh $name $owner $latlon > "${peersdir}/${name}" done