}
function start () {
- rm /git-mirror/RUNNING_MIRROR
+ if pgrep git-mirror >& /dev/null; then
+ echo "git-mirror instance is running"
+ else
+ echo "Cleaned RUNNING_MIRROR"
+ rm /git-mirror/RUNNING_MIRROR
+ fi
+}
+
+function status () {
+ pids=$(pgrep git-mirror)
+ if [ -n "$pids" ] ; then
+ echo "Active processes"
+ ps $pids
+ else
+ echo "No running instance of git-mirror"
+ fi
+ echo "Lock file status"
+ ls -l /git-mirror/RUNNING_MIRROR
}
function main () {
case $1 in
start) start;;
stop) stop;;
+ status) status;;
*) echo "Usage: $COMMAND start|stop";;
esac
}