From 1e69db8e6e7f17c1278e170bd1410e9fb18210eb Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Tue, 8 Oct 2013 19:48:59 +0100 Subject: Verify that cgit shows public repos --- git.liw.fi.sh | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'git.liw.fi.sh') diff --git a/git.liw.fi.sh b/git.liw.fi.sh index 9f03ff3..6f20266 100644 --- a/git.liw.fi.sh +++ b/git.liw.fi.sh @@ -124,3 +124,24 @@ destroy_repo() { two_step run_gitano_as "$1" destroy "$2" } + + +# Does cgit show a repository? + +cgit_shows() +{ + local tempfile="$(mktemp)" + wget -q -O- "http://$GITHOST/cgi-bin/cgit/cgit.cgi/$1/" \ + > "$tempfile" 2>&1 + if grep 'Repository seems to be empty' "$tempfile" + then + ret=0 + elif grep 'Commit message' "$tempfile" + then + ret=0 + else + ret=1 + fi + rm -f "$tempfile" + return $ret +} -- cgit v1.2.1