25 lines
341 B
Text
Executable file
25 lines
341 B
Text
Executable file
#!/bin/sh -ex
|
|
|
|
if [ -z "$SSH_AGENT_PID" ]; then
|
|
exec ssh-agent "$0" "$@"
|
|
fi
|
|
|
|
ssh-add
|
|
|
|
update_repo() {
|
|
cd "$1" || return
|
|
printf 'Updating repository \033[1m%s\033[0m...\n' "$1"
|
|
git pull
|
|
}
|
|
|
|
cd ~/git
|
|
|
|
set +ex
|
|
for i in *; do
|
|
while [ "$(jobs -p | wc -l)" -ge 4 ]; do
|
|
sleep 1
|
|
done
|
|
update_repo "$i" &
|
|
done
|
|
|
|
wait
|