Keep track of the mirror target directory in an environment variable.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 27 Oct 2012 12:02:06 +0000 (13:02 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 27 Oct 2012 12:02:06 +0000 (13:02 +0100)
Now we only need to configure it in one place.

bin/run-mirrors
etc/ftpsync-common.conf

index ef7f92c..9c24c7d 100755 (executable)
@@ -10,6 +10,7 @@ esac
 
 ## Set up a plausible environment.
 HOME=/var/lib/mirror-admin; export HOME; cd
+MIRRORS=/mnt/mirrors; export MIRRORS
 PATH=$HOME/bin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/local/bin:/usr/local/sbin
 export PATH
 umask 002
index 61712f4..5af48ee 100644 (file)
@@ -15,7 +15,7 @@
 ## CAREFUL, this directory will contain the mirror. Everything else that
 ## might have happened to be in there WILL BE GONE after the mirror sync!
 : ${LABEL="debian"}
-: ${TO="/mnt/mirror/$LABEL/"}
+: ${TO="$MIRRORS/$LABEL/"}
 
 ## The upstream name of the rsync share.
 : ${RSYNC_PATH="$LABEL"}