Merge pull request #720 from maxking/fix-chown

Create the var directory before trying to chown.
This commit is contained in:
Abhilash Raj
2024-08-31 20:51:48 +05:30
committed by GitHub

View File

@@ -247,7 +247,17 @@ echo "HYPERKITTY_API_KEY not defined, skipping HyperKitty setup..."
fi fi
# Now chown the places where mailman wants to write stuff. # Now chown the places where mailman wants to write stuff.
chown -R mailman /opt/mailman/var VAR_DIR="/opt/mailman/var"
# Check if the directory exists
if [ ! -d "$VAR_DIR" ]; then
# Directory does not exist, so create it
mkdir -p "$VAR_DIR"
echo "Directory $VAR_DIR created."
else
echo "Directory $VAR_DIR already exists."
fi
chown -R mailman $VAR_DIR
# Generate the LMTP files for postfix if needed. # Generate the LMTP files for postfix if needed.
su-exec mailman mailman aliases su-exec mailman mailman aliases