summaryrefslogtreecommitdiff
path: root/doc/darcs-cm
diff options
context:
space:
mode:
authorbringert <bringert@cs.chalmers.se>2005-11-24 13:05:27 +0000
committerbringert <bringert@cs.chalmers.se>2005-11-24 13:05:27 +0000
commit4e39769f07e65f7d7e3cb903b8d8b3a5812e267b (patch)
tree5282eda202563de3d6e1f5addcd30dfd8f4f33f7 /doc/darcs-cm
parent853bcef7b9251ed39bd3895abb0d48699e508422 (diff)
Include darcs-cm wrapper.
Diffstat (limited to 'doc/darcs-cm')
-rw-r--r--doc/darcs-cm29
1 files changed, 29 insertions, 0 deletions
diff --git a/doc/darcs-cm b/doc/darcs-cm
new file mode 100644
index 000000000..2f9af8fec
--- /dev/null
+++ b/doc/darcs-cm
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+DARCS=`which darcs`
+SSH=`which ssh`
+REPOSERVER=gfreposerver
+
+if [ ! -x "$SSH" ]; then
+ echo "ssh ($SSH): command not found" 1>&2
+ exit 1
+fi
+
+if [ "$1" = "--stop" ]; then
+ $SSH -O exit "$REPOSERVER"
+ exit $?
+fi
+
+if [ ! -x "$DARCS" ]; then
+ echo "darcs ($DARCS): command not found" 1>&2
+ exit 1
+fi
+
+if ! $SSH -O check "$REPOSERVER" >& /dev/null; then
+ echo "Connection to $REPOSERVER is down, connecting..."
+ $SSH -f -M "$REPOSERVER" \
+ "bash -c 'while true; do echo -n .; sleep 30; done'" > /dev/null
+ sleep 1
+fi
+
+exec $DARCS "$@"