#!/usr/bin/bash

(
flock -n 9 || exit 1
# ... commands executed under lock ...
CGIT_CONFIG="/etc/cgitrc.slow"   /var/www/cgi-bin/cgit  --scan-path=/var/lib/dist-git/git >/var/cache/cgit/repo-list.rc.new 2>/dev/null && mv -f /var/cache/cgit/repo-list.rc.new /var/cache/cgit/repo-list.rc

) 9>/var/lock/mylockfile
