chiark
/
gitweb
/
~mdw
/
mirror-admin
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a61843d
)
bin/run-mirrors: Command line lists patterns limiting mirrors to run.
author
Mark Wooding
<mdw@distorted.org.uk>
Thu, 28 Aug 2014 13:53:39 +0000
(14:53 +0100)
committer
Mark Wooding
<mdw@distorted.org.uk>
Thu, 28 Aug 2014 13:53:39 +0000
(14:53 +0100)
bin/run-mirrors
patch
|
blob
|
blame
|
history
diff --git
a/bin/run-mirrors
b/bin/run-mirrors
index 9c24c7d38020005761815a106184318e93258aaa..34a373387a870a850506fb01e7294fb5103fe993 100755
(executable)
--- a/
bin/run-mirrors
+++ b/
bin/run-mirrors
@@
-5,7
+5,7
@@
set -e
## Make sure we're running as the right user.
case $(id -un) in
mirror) ;;
## 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.
esac
## Set up a plausible environment.
@@
-33,9
+33,20
@@
logrotate -s var/logrotate.state etc/logrotate.conf
## Let SIGINT take out the children only.
trap "" INT
## 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
## 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
base=${file##*/}; base=${base#[0-9]*-}
(
echo