1 2 3 4 5 6 7 8 9 10 11
if sd_booted; then systemctl daemon-reload if [ $1 -eq 1 ]; then # Initial installation systemctl --no-reload preset caddy || : else # Package upgrade, not uninstall /lib/systemd/systemd-update-helper mark-restart-system-units caddy || : fi fi
1 2 3
groupadd -r -f _caddy 2>/dev/null ||: useradd -r -N -g _caddy -G _webserver -c 'Caddy web server' \ -s /sbin/nologin -M -d /var/lib/caddy _caddy 2>/dev/null ||:
1 2 3 4 5
if [ $1 -eq 0 ] && sd_booted; then # Package removal, not upgrade systemctl --no-reload -q disable --now caddy || : fi