12345678910111213141516171819202122232425262728293031323334353637383940 |
- #! /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 &&
-
- rm -f /usr/local/bin/sitegen &&
- 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 &&
-
- rm -f /etc/bash_completion.d/sitegen &&
- cp "${dir}/bash/sitegen.completion" /etc/bash_completion.d/sitegen &&
-
- (a2disconf letsencrypt && rm -f /etc/apache2/conf-available/letsencrypt.conf || exit 0) &&
- 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
|