You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.2 KiB
Bash
52 lines
1.2 KiB
Bash
#!/bin/bash
|
|
# file: updateCodigo.sh
|
|
|
|
basePath="/d/codigo"
|
|
|
|
mkdir -p "$basePath/android";
|
|
mkdir -p "$basePath/arduino-testes";
|
|
mkdir -p "$basePath/arduino-xbee-sensors";
|
|
mkdir -p "$basePath/Denariu_Votacoes";
|
|
mkdir -p "$basePath/domotica";
|
|
mkdir -p "$basePath/GCI";
|
|
mkdir -p "$basePath/inosat";
|
|
mkdir -p "$basePath/LavasMe";
|
|
mkdir -p "$basePath/Metron";
|
|
mkdir -p "$basePath/SafetyLock";
|
|
mkdir -p "$basePath/SniffMyCalls";
|
|
mkdir -p "$basePath/SRC_SafetyRally";
|
|
mkdir -p "$basePath/SRGprs";
|
|
mkdir -p "$basePath/HangFireServer";
|
|
|
|
cd $basePath
|
|
|
|
for dir in `find . -mindepth 1 -maxdepth 1 -type d`
|
|
do
|
|
echo "--- check if repo $dir exists ---"
|
|
path="$basePath/$dir"
|
|
if [ -d $path/.git ]; then
|
|
echo "--- pull ---"
|
|
cd $path
|
|
|
|
git fetch --all
|
|
git reset --hard origin/master
|
|
else
|
|
echo "--- clone ---"
|
|
git clone https://bitbucket.org/denariu/$dir.git
|
|
fi
|
|
done
|
|
|
|
mkdir -p "$basePath/xx0003";
|
|
|
|
echo "--- check if repo xx0003 exists ---"
|
|
path="$basePath/xx0003"
|
|
if [ -d $path/.git ]; then
|
|
echo "--- pull ---"
|
|
cd $path
|
|
|
|
git fetch --all
|
|
git reset --hard origin/master
|
|
else
|
|
echo "--- clone ---"
|
|
git clone ssh://git@prontolavar.no-ip.org:16501/srv/git/xx0003.git
|
|
fi |