Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

executable file 28 lines (23 sloc) 0.619 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
#!/bin/sh
# Copyright © 2010 by Daniel Friesel <derf@chaosdorf.de>
# License: WTFPL:
# 0. You just DO WHAT THE FUCK YOU WANT TO.
#
# You probably need to run this check via sudo. For /etc,
# > nagios ALL=(root) NOPASSWD: /usr/local/lib/nagios/plugins/check_git_status /etc
# should do the job.

REPO="${1}"

if [ -z "${REPO}" -o ! -d "${REPO}" ]
then
echo 'No repo specified or no such repo';
exit 3
fi

cd "${REPO}" || exit 3

if [ -z "$(git ls-files --modified --deleted --others --exclude-standard)" ]
then
echo "No uncommited changes in ${REPO}"
exit 0
else
echo "Uncommited changes in ${REPO}"
exit 1
fi
Something went wrong with that request. Please try again.