#!/bin/bash
VERSION=1.0
GITUSR=gitgsb
GITPRJ=gsb
GITPATH=/home/${GITUSR}/${GITPRJ}.git

getent passwd ${GITUSR} >> /dev/null
if [[ $? != 0 ]]; then
  echo "creation utilisateur ${GITUSR} ..."
  /sbin/useradd -m -d /home/${GITUSR} -s /bin/bash ${GITUSR} 
  echo "${GITUSR}:${GITUSR}" | /sbin/chpasswd 
fi
if [[ -d ${GITPATH} ]]; then 
  rm -rf ${GITPATH} 
fi
su -c "git clone --bare http://sio.lyc-lecastel.fr/${GITPRJ}.git ${GITPATH}" ${GITUSR}

su -c "cd ${GITPATH}/hooks && cp post-update.sample post-update && bash post-update" ${GITUSR}
ln -s ${GITPATH} /var/www/html/${GITPRJ}.git

echo "depot gsb.git synchronisé ..."

 
 

