#! /usr/bin/env sh dir="$(dirname $(readlink -f "${0}"))" pip3 install -r "${dir}/requirements.txt" && if [ ! -e /etc/sitegen ] then rm -f /etc/sitegen && cp -r "${dir}/sitegen" /etc/sitegen fi && cp "${dir}/sitegen.py" /usr/local/bin/sitegen && for typedir in "${dir}"/sitegen/hooks-available/* do for hookfile in "${typedir}"/* do type=$(basename "${typedir}") hook=$(basename "${hookfile}") sitegen --hook-enable "${type}.${hook}" done done && cp "${dir}/bash/sitegen.completion" /etc/bash_completion.d/sitegen && a2disconf letsencrypt && rm -f /etc/apache2/conf-available/sitegen.conf && cp "${dir}/apache/sitegen.conf" /etc/apache2/conf-available/sitegen.conf && a2enconf sitegen && service apache2 reload && if [ ! -e /etc/cron.d/sitegen-cert-renew ] then rm -f /etc/cron.d/cert-renew && cp "${dir}/cron/sitegen-cert-renew" /etc/cron.d/sitegen-cert-renew && service cron reload fi