#!/bin/sh
#
echo "SCRIPT $0 starting"

MYNAME=`uname -n`

ZZ=/zz
MYNAME=`uname -n`

if [ -f ${ZZ}/zSyno/secrets/.${MYNAME} ]
then
    . ${ZZ}/zSyno/secrets/.${MYNAME}
fi

REPOSITE=${PUBLIC_SITE}
REPO=${PUBLIC_REPO}
KEYS=${PUBLIC_KEYS}

if [ ! -d ${ZZ} ]
then
    mkdir ${ZZ}
fi

for i in ${REPO}
do
    echo $i
    if [ ! -d ${ZZ}/$i ]
    then
        echo $i
        cd ${ZZ}
        git clone ${REPOSITE}/${i}.git
#        GIT_SSH_COMMAND="ssh -o 'StrictHostKeyChecking no' -i ${KEYS}" git clone ${REPOSITE}/${i}.git
    fi
done


exit 0
