ssh $repo list | perl -ne '/(\S+).git/ and print "$1\n"'
}
-_git_conn_check=" "
+_git_conn_check=""
git_conn_check() {
#local dest=$(git config --local --get remote.origin.url | sed -e 's/:.*$//' -e 's/^.*@//')
local dest=$(git config --local --get remote.origin.url)
*"@"*) timeout 5 ssh -o BatchMode=yes -o ConnectTimeout=5 $dest true && ok=1 ;;
*) nc -z -w 5 $dest && ok=1 ;;
esac
-#echo "$ok: git=$(git config --local --get remote.origin.url) | dest=$dest | url2nc="$(url2nc $(git config --local --get remote.origin.url))
+ [ -z "$_git_conn_check" ] && _git_conn_check=" "
_git_conn_check="${_git_conn_check}$dest=$ok "
+
+ if [ "$ok" != "1" ]; then
+ logger -t $NAME -s "Can't connect to $dest"
+ return 1
+ fi
+
;;
esac
- #if ! timeout 5 ssh BatchMode=yes -o ConnectTimeout=5 $dest true; then
- if [ "$ok" != "1" ]; then
- logger -t $NAME -s "Can't connect to $dest"
- return 1
- fi
-
return 0
}