From a82532e291f5f0b287b4ff78473a16eeb61a2184 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Thu, 18 May 2023 09:10:30 +0200 Subject: avoid removing user accounts involved in web hosting --- localrmstaleaccounts | 4 ++++ 1 file changed, 4 insertions(+) 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 -- cgit v1.2.3