From 5a7f1e1df8e567f9ce4a0280d7deb5747e2c4911 Mon Sep 17 00:00:00 2001
From: Michal Heppler <72906@mail.muni.cz>
Date: Tue, 14 Feb 2017 13:00:47 +0100
Subject: [PATCH] =?UTF-8?q?P=C5=99id=C3=A1n=C3=AD=20testovac=C3=ADho=20skr?=
 =?UTF-8?q?iptu=20pro=20Nagios?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 check_gitlab | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
 create mode 100755 check_gitlab

diff --git a/check_gitlab b/check_gitlab
new file mode 100755
index 0000000..c946cee
--- /dev/null
+++ b/check_gitlab
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+GITLAB_REPO='git@gitlab.ics.muni.cz:72906/gitlab_zije.git'
+FILE_IN_REPO='gitlab_zije/gitlab_zije'
+
+HTTP_REPO='https://gitlab.ics.muni.cz/72906/gitlab_zije/raw/master/gitlab_zije'
+
+TMPREPO=`mktemp -d /tmp/check_gitlab.XXXX`
+
+$( cd "${TMPREPO}"; git clone "${GITLAB_REPO}" &>/dev/null; )
+
+if [ -e "${TMPREPO}/${FILE_IN_REPO}" ]; then
+
+	rm -rf "${TMPREPO}"
+
+	if wget -q --no-check-certificate -O /dev/null "${HTTP_REPO}"; then
+		echo -n  "OK: git se zda plne funkcni|"
+		exit 0
+	else
+		echo -n "FAIL: Nepovedlo se stahnout soubor pres HTTP!|"
+		exit 1
+	fi
+else
+	rm -rf "${TMPREPO}"
+
+	echo -n "FAIL: git clone neni funkcni!|"
+	exit 1
+fi
-- 
GitLab