#!/bin/bash if [ "${1}" = "init" ]; then # setup apache sed -i "s/ScriptAlias \/cgit\//ScriptAlias \//" /etc/apache2/conf-enabled/cgit.conf sed -i "/RedirectMatch/d" /etc/apache2/conf-enabled/cgit.conf ex -s -c $(grep -n "^Alias" /etc/apache2/conf-enabled/cgit.conf | cut -d ":" -f 1)m0 -c w -c q /etc/apache2/conf-enabled/cgit.conf sed -i "s/\/usr\/share\/cgit/\/usr\/share\/cgit-docker/" /etc/apache2/conf-enabled/cgit.conf service apache2 start # populate assets if [ ! $(ls -A /usr/share/cgit-docker) ]; then cp /usr/share/cgit/* /usr/share/cgit-docker/ fi # run complex init /docker-init.py # loop tail -f /dev/null else exec "$@" fi