post_install() { mkdir -p /etc/ssl/caddy && chown -R http:http /etc/ssl/caddy } pre_upgrade() { systemctl stop caddy } post_upgrade() { systemctl daemon-reload if [ $(vercmp $2 0.9.3-5) -lt 0 ]; then userdel -f www-data groupdel www-data chown -R http:http /etc/ssl/caddy echo "Migration guide for caddy <0.9: https://github.com/klingtnet/caddy-AUR/blob/master/README.md" echo "With the package level 0.9.3-5 the caddy user is changed from 'www-data' to 'http'." echo "You need to update the permissions for your caddy web directory with 'chown -R http:http '" fi } pre_remove() { systemctl stop caddy } post_remove() { systemctl daemon-reload }