summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoerg Jaspert <joerg@debian.org>2008-11-17 21:12:19 +0100
committerJoerg Jaspert <joerg@debian.org>2008-11-17 21:12:19 +0100
commit522c96df683705b80d8a60c8115874220b343172 (patch)
tree66833ba8fe5bbd1d26cfdbbc2bd54de8c5075b14
parent738e371884099841c166322b0263739c32890b50 (diff)
runmirrors
document the config add default for keyfile Signed-off-by: Joerg Jaspert <joerg@debian.org>
-rwxr-xr-xbin/runmirrors10
-rw-r--r--etc/runmirrors.conf.sample60
2 files changed, 53 insertions, 17 deletions
diff --git a/bin/runmirrors b/bin/runmirrors
index 19bdcb5..676bff7 100755
--- a/bin/runmirrors
+++ b/bin/runmirrors
@@ -37,9 +37,6 @@ fi
# Read our config file
. "${BASEDIR}/etc/${NAME}.conf"
-# Make sure some variables are always in the environment
-export HOME LOGNAME USER PATH BASEDIR
-
# Source our common functions
. "${BASEDIR}/etc/common"
@@ -62,6 +59,13 @@ SSH_OPTS=${SSH_OPTS:-""}
PUSHARCHIVE=${PUSHARCHIVE:-"${CONF}"}
# How long to wait for mirrors to do stage1 if we have multi-stage syncing
PUSHDELAY=${PUSHDELAY:-240}
+# Which ssh key to use?
+KEYFILE=${KEYFILE:-".ssh/pushmirror"}
+
+if ! [ -f "${KEYFILE}" ]; then
+ error "SSH Key ${KEYFILE} does not exist" >> ${LOG}
+ exit 5
+fi
# Hooks
HOOK1=${HOOK1:-""}
diff --git a/etc/runmirrors.conf.sample b/etc/runmirrors.conf.sample
index 6bb1f89..c7f5788 100644
--- a/etc/runmirrors.conf.sample
+++ b/etc/runmirrors.conf.sample
@@ -1,14 +1,46 @@
-HOME=~archvsync
-LOGNAME="archvsync"
-USER="archvsync"
-MAIL=
-PATH="/bin:/usr/bin:$HOME"
-KEYFILE=.ssh/pushmirror
-# Hook scripts can be run at various places.
-# Leave them blank if you don't want any
-# Hook1: After reading config, before doing the first real action
-# Hook2: Between two hosts to push
-# Hook3: When everything is done
-HOOK1=
-HOOK2=
-HOOK3=
+########################################################################
+########################################################################
+## This is a sample configuration file for the runmirror script. ##
+## Most of the values are commented out and just shown here for ##
+## completeness, together with their default value. ##
+########################################################################
+########################################################################
+
+## Which ssh key to use?
+#KEYFILE=.ssh/pushmirror
+
+## The directory for our logfiles
+#LOGDIR="${BASEDIR}/log"
+
+## Our own logfile
+#LOG="${LOGDIR}/${NAME}.log"
+
+## Our lockfile directory
+#LOCKDIR="${BASEDIR}/locks"
+
+## How to rotate the log
+#SAVELOG="savelog -t -c 14"
+
+## Our mirrorfile
+#MIRRORS="${BASEDIR}/etc/${NAME}.mirror"
+
+## extra ssh options we might want. *hostwide*
+#SSH_OPTS=""
+
+## Whats our archive name? We will also tell our leafs about it
+## This is usually empty, but if we are called as "runmirrors bpo"
+## it will default to bpo. This way one runmirrors script can serve
+## multiple archives, similar to what ftpsync does.
+#PUSHARCHIVE="${CONF}"
+
+## How long to wait for mirrors to do stage1 if we have multi-stage syncing
+#PUSHDELAY=240
+
+## Hook scripts can be run at various places.
+## Leave them blank/commented out if you don't want any
+## Hook1: After reading config, before doing the first real action
+## Hook2: Between two hosts to push
+## Hook3: When everything is done
+#HOOK1=""
+#HOOK2=""
+#HOOK3=""