From: Mark Wooding Date: Thu, 28 Aug 2014 13:55:23 +0000 (+0100) Subject: Merge branch 'master' into distorted X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/mirror-admin/commitdiff_plain/36ed96dfe5eb08b68dfaf8a59691bedb92edf08d?ds=inline;hp=-c Merge branch 'master' into distorted * master: bin/run-mirrors: Command line lists patterns limiting mirrors to run. --- 36ed96dfe5eb08b68dfaf8a59691bedb92edf08d diff --combined bin/run-mirrors index 8fb9ccc,34a3733..ed6fb46 --- a/bin/run-mirrors +++ b/bin/run-mirrors @@@ -5,12 -5,12 +5,12 @@@ set - ## Make sure we're running as the right user. case $(id -un) in mirror) ;; - *) exec userv -fstdin=/dev/null mirror run ;; + *) exec userv -fstdin=/dev/null mirror run "$@";; esac ## Set up a plausible environment. -HOME=/var/lib/mirror-admin; export HOME; cd -MIRRORS=/mnt/mirrors; export MIRRORS +HOME=/var/lib/mirror; export HOME; cd +MIRRORS=/mnt/ftp/pub/mirrors; export MIRRORS PATH=$HOME/bin:/usr/bin:/usr/sbin:/bin:/sbin:/usr/local/bin:/usr/local/sbin export PATH umask 002 @@@ -33,9 -33,20 +33,20 @@@ logrotate -s var/logrotate.state etc/lo ## Let SIGINT take out the children only. trap "" INT + ## By default run all of the scripts. + case $# in 0) set "*" ;; esac + ## Now do the various mirroring things. for file in $(run-parts --list etc/mirrors.d); do [ -x "$file" ] || continue + + matchp=nil + leaf=$(echo "$file" | sed 's:^.*/::; s/^[0-9]\+[-_.]//') + for pat in "$@"; do + case "$leaf" in $pat) matchp=t; break ;; esac + done + case $matchp in nil) continue ;; esac + base=${file##*/}; base=${base#[0-9]*-} ( echo