| Left: | ||
| Right: |
| LEFT | RIGHT |
|---|---|
| 1 #!/bin/bash | 1 #!/bin/bash |
| 2 | 2 |
| 3 run_file="/var/run/update_update_manifests" | 3 lock_file="<%= sitescripts_var_dir %>/update_update_manifests.lock" |
|
mathias
2014/07/25 07:04:28
At http://mywiki.wooledge.org/BashFAQ/045 please f
Felix Dahlke
2014/07/25 09:52:01
Done.
| |
| 4 | 4 |
| 5 if [[ -f $run_file ]]; then | 5 exec 9>"$lock_file" |
| 6 exit 0 | 6 flock -n 9 || exit 0 |
| 7 fi | |
| 8 | |
| 9 echo "$$" >> "$run_file" | |
| 10 | 7 |
| 11 <% repositories_to_sync.each do |repository| %> | 8 <% repositories_to_sync.each do |repository| %> |
| 12 hg pull -q -u -R <%= base_dir %>/<%= repository %> | 9 hg pull -q -R "<%= sitescripts_var_dir %>/<%= repository %>" |
| 13 <% end %> | 10 <% end %> |
| 14 | 11 |
| 15 export PYTHONPATH=/opt/sitescripts | 12 export PYTHONPATH=/opt/sitescripts |
| 16 python -m sitescripts.extensions.bin.updateUpdateManifests | 13 python -m sitescripts.extensions.bin.updateUpdateManifests |
| 17 | 14 |
| 18 rm -f "$run_file" | 15 rm -f "$lock_file" |
| LEFT | RIGHT |