mob.html: personal mob updates do NOT generate CIA/JSON notifications
[girocco.git] / jobs / gitwebcache.sh
blob9b94c267a7de0e10cd53a3b9a12447bbef27b326
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 && export REQUEST_METHOD
23 perl -e 'do "./gitweb.cgi"; END {
24 fill_project_list_info([], "rebuild-cache") }' >/dev/null 2>&1
26 rm ${LOCK_FILE}