--- /dev/null
+#!/bin/sh
+#
+# openafs-backend -- remctl backend for OpenAFS maintenance.
+#
+# This is a remctl backend for running various OpenAFS maintenance tasks that
+# are managed by openafs.stanford.edu. Currently, it supports restarting
+# Gerrit and updating the website in AFS.
+
+PATH=/usr/local/bin:/bin:/usr/bin; export PATH
+
+command="$1"
+shift
+case $command in
+ help)
+ echo 'OpenAFS maintenance commands:'
+ echo ' openafs export-web [prod] Export web pages to AFS'
+ echo ' openafs restart-gerrit Restart Jetty for Gerrit'
+ exit 0
+ ;;
+ export-web)
+ if [ -n "$1" ] && [ x"$1" != xprod ] ; then
+ echo 'Syntax: openafs export-web [prod]' >&2
+ exit 1
+ fi
+ if [ x"$1" = xprod ] ; then
+ export_htdocs -p
+ else
+ export_htdocs
+ fi
+ ;;
+ restart-gerrit)
+ /etc/init.d/jetty restart
+ sleep 5
+ /etc/init.d/apache restart
+ ;;
+ *)
+ echo "Unknown command $command" >&2
+ exit 1
+ ;;
+esac