jobs/clonecheck.sh: Fix permission setup
[girocco.git] / jobs / clonecheck.sh
blob947cc90fc8f8efadbd5a6da14677d7342abba0c8
1 #!/bin/sh
3 . @basedir@/shlib.sh
5 shopt -s nullglob
7 cd "$cfg_mqueuedir"/to-clone
8 get_repo_list_here |
9 while read dir; do
10 mkdir -m 0775 -p "$cfg_reporoot/$(dirname "$dir")"
11 # The cp will sort out permissions.
12 cp -a "$dir" "$cfg_reporoot/$(dirname "$dir")"
13 rm -r "$dir"
14 chmod 02775 "$cfg_reporoot/$dir"
15 chown -R ."$cfg_owning_group" "$cfg_reporoot/$dir"
16 "$cfg_basedir"/mirroring/clone.sh "$dir"
17 exit # next dir at next cron invocation, to be safe
18 done