2016-10-22 17:52:48 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
wd="$(pwd)"
|
|
|
|
temp="$(mktemp)"
|
2017-05-30 10:47:13 +02:00
|
|
|
name="$(basename "$0")"
|
2016-10-22 17:52:48 +02:00
|
|
|
|
|
|
|
find /data -name '.git' -exec dirname \{\} \; | while read gitrepo; do
|
|
|
|
cd "$gitrepo"
|
2017-05-30 10:47:13 +02:00
|
|
|
case "$name" in
|
|
|
|
"gitfetcher")
|
|
|
|
echo "$gitrepo"
|
|
|
|
git remote | while read remote; do
|
|
|
|
git fetch --prune "$remote"
|
|
|
|
done 2>&1 | sed 's/^/ /'
|
|
|
|
;;
|
|
|
|
"gitlister")
|
|
|
|
if git status | grep -q behind; then
|
|
|
|
echo "$gitrepo"
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
esac
|
2016-10-22 17:52:48 +02:00
|
|
|
done
|
|
|
|
|
|
|
|
cd "$wd"
|