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