| 1 | #!/bin/shscip-shell filesystem . . `/bin/sh`. |
| 2 | set -e |
| 3 | |
| 4 | if [scip-shell system . . `[`. -d /run/systemd/systemscip-shell filesystem . . `/run/systemd/system`. ]; then |
| 5 | systemctl --system daemon-reload >/dev/nullscip-shell filesystem . . `/dev/null`. || truescip-shell system . . true. |
| 6 | fi |
| 7 | |
| 8 | if [scip-shell system . . `[`. "$1" = "remove" ]; then |
| 9 | if [scip-shell system . . `[`. -x "/usr/bin/deb-systemd-helperscip-shell filesystem . . `/usr/bin/deb-systemd-helper`." ]; then |
| 10 | deb-systemd-helperscip-shell system . . deb-systemd-helper. mask caddy.service >/dev/nullscip-shell filesystem . . `/dev/null`. || truescip-shell system . . true. |
| 11 | deb-systemd-helperscip-shell system . . deb-systemd-helper. mask caddy-api.service >/dev/nullscip-shell filesystem . . `/dev/null`. || truescip-shell system . . true. |
| 12 | fi |
| 13 | fi |
| 14 | |
| 15 | if [scip-shell system . . `[`. "$1" = "purge" ]; then |
| 16 | if [scip-shell system . . `[`. -x "/usr/bin/deb-systemd-helperscip-shell filesystem . . `/usr/bin/deb-systemd-helper`." ]; then |
| 17 | deb-systemd-helperscip-shell system . . deb-systemd-helper. purge caddy.service >/dev/nullscip-shell filesystem . . `/dev/null`. || truescip-shell system . . true. |
| 18 | deb-systemd-helperscip-shell system . . deb-systemd-helper. purge caddy-api.service >/dev/nullscip-shell filesystem . . `/dev/null`. || truescip-shell system . . true. |
| 19 | deb-systemd-helperscip-shell system . . deb-systemd-helper. unmask caddy.service >/dev/nullscip-shell filesystem . . `/dev/null`. || truescip-shell system . . true. |
| 20 | deb-systemd-helperscip-shell system . . deb-systemd-helper. unmask caddy-api.service >/dev/nullscip-shell filesystem . . `/dev/null`. || truescip-shell system . . true. |
| 21 | fi |
| 22 | # 'purge' is not supposed to leave package files behind, |
| 23 | # so remove the user along with other dirs. |
| 24 | userdelscip-shell system . . userdel. -r caddy || truescip-shell system . . true. |
| 25 | rmscip-shell system . . rm. -rf /var/lib/caddyscip-shell filesystem . . `/var/lib/caddy`. /var/log/caddyscip-shell filesystem . . `/var/log/caddy`. /etc/caddyscip-shell filesystem . . `/etc/caddy`. |
| 26 | fi |