#!/bin/bash ARGV1=$1 BASEPATH=`pwd` cd $BASEPATH # Check to see if the directory already exists and has a working .git directory checkforgit() { # log_action_end_msg "$1" ${2:+"$2"} path=$1 if [ -d $path ]; then echo $path already exists if [ "$ARGV1" = update ] ; then cd $path git pull git submodule update --init --recursive cd $BASEPATH fi return 0 else echo $path does not exist. need to git clone here return -1 fi } gitclone() { # log_action_end_msg "$1" ${2:+"$2"} src=$1 path=$2 if checkforgit $path ; then return -1; fi git clone $src $path result=$? echo git clone returned $result return $result } gitupdate() { # log_action_end_msg "$1" ${2:+"$2"} src=$1 path=$2 #echo path=$path #echo src=$src cd $path ; git update } witgitclone() { base=$1 path=$2 #echo base src=$base #echo path=$path if checkforgit $path ; then return -1; fi src='ssh://root@ping.wit.com/var/lib/'$base gitclone $src $path if checkforgit $path ; then return -1; fi src='git://ping.wit.com/'$base gitclone $src $path if checkforgit $path ; then return -1; fi src='http://ping.wit.com/'$base gitclone $src $path # log_action_end_msg "$1" ${2:+"$2"} exit 0 } gitclone 'git@github.com:witstartup/resumes.git' 'corp/resumes' gitclone 'git@github.com:witstartup/org-docs.git' 'corp/org-docs' witgitclone 'git/cloud/witcoredns' 'cloud/witcoredns' witgitclone 'git/junk/jcarrbox' 'cloud/jcarrbox' gitclone 'git@github.com:witstartup/AndroidApp.git' 'phone/AndroidApp' gitclone 'git@github.com:witstartup/webrtc-example.git' 'phone/webrtc-example' gitclone 'git@github.com:witstartup/group-chat.git' 'phone/group-chat' gitclone 'git@github.com:witstartup/VirtexEval.git' 'crypto/VirtexEval' witgitclone 'git/crypto/realtime-crypto-data' 'crypto/realtime-crypto-data' witgitclone 'git/crypto/mining-binaries' 'crypto/mining-binaries' gitclone 'https://github.com/ethereum-mining/ethminer.git' 'crypto/mining-code/ethminer' gitclone 'https://github.com/ethereum/cpp-ethereum' 'crypto/mining-code/cpp-ethereum' gitclone 'https://github.com/vthoang/cgminer.git' 'crypto/mining-code/cgminer-vthoang' gitclone 'https://github.com/ckolivas/cgminer.git' 'crypto/mining-code/cgminer-ckolivas' gitclone 'https://github.com/zcash/zcash.git' 'crypto/mining-code/zcash' exit 0