Fix permission problems
[girocco.git] / jobs / gitwebcache.sh
blob9254f4c186dac0f2f7b2df234e90577d694b1005
1 #!/bin/bash
3 . @basedir@/shlib.sh
5 set -e
7 # Make sure we don't run twice.
8 if [ -s /tmp/gitweb/lock ] && kill -0 $(cat /tmp/gitweb/lock); then
9 echo "Already running (stuck?) with pid $(cat /tmp/gitweb/lock)" >&2
10 exit 1
12 echo $$ >/tmp/gitweb/lock
14 cd "$cfg_cgiroot"
16 # Re-generate the cache; we must be in same group as cgi user and
17 # $cache_grpshared must be 1.
18 # We get rid even of stderr since it's just junk from broken repos.
19 perl -le 'require("./gitweb.cgi"); END { my @list = git_get_projects_list(); cached_project_list_info(\@list, 1, 1, 1); }' >/dev/null 2>&1
21 rm /tmp/gitweb/lock