summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2023-05-18 09:10:30 +0200
committerJonas Smedegaard <dr@jones.dk>2023-05-18 09:10:30 +0200
commita82532e291f5f0b287b4ff78473a16eeb61a2184 (patch)
tree3effcc44011a930db773dae143084829cc632f81
parent67c5793ecccb05f9fad08958a121d0b7ae857b4e (diff)
avoid removing user accounts involved in web hosting
-rwxr-xr-xlocalrmstaleaccounts4
1 files changed, 4 insertions, 0 deletions
diff --git a/localrmstaleaccounts b/localrmstaleaccounts
index f3c9b12..c830fb0 100755
--- a/localrmstaleaccounts
+++ b/localrmstaleaccounts
@@ -65,6 +65,10 @@ for user in "$@"; do
warn "Skipping user $user: Email gets forwarded"
elif [ ! -d "$home/Maildir" ]; then
warn "Skipping user $user: Missing Maildir"
+ elif [ -d "/var/www/vhosts/$user" ]; then
+ warn "Skipping user $user: Web hosting at /var/www/vhosts"
+ elif grep -q "$home" /etc/apache2/sites-enabled/*.conf; then
+ warn "Skipping user $user: Web hosting below /etc/apache2/sites-enabled"
elif postalias -s /etc/aliases | grep -qP ':\s+'"$user"'$'; then
warn "Skipping user $user: target in /etc/aliases"
elif find -- /var/lib/radicale/collections/collection-root -maxdepth 1 -type d -name "$user" -not -empty | grep -q '^'; then