diff --git a/install-mailcow-debian.sh b/install-mailcow-debian.sh index 4c0b148..d1db250 100644 --- a/install-mailcow-debian.sh +++ b/install-mailcow-debian.sh @@ -166,7 +166,18 @@ if ! is_step_completed "mailcow_installed"; then # Generate config if not already generated if [ ! -f "$MAILCOW_DIR/mailcow.conf" ]; then cd "$MAILCOW_DIR" - echo "$MAILCOW_HOSTNAME" | ./generate_config.sh + + # Make sure generate_config.sh is executable + chmod +x generate_config.sh + + # Create configuration file with proper permissions + su - dockeruser -c "cd $MAILCOW_DIR && echo \"$MAILCOW_HOSTNAME\" | ./generate_config.sh" + + # Verify the configuration file was created + if [ ! -f "$MAILCOW_DIR/mailcow.conf" ]; then + log_message "Error: Failed to generate mailcow.conf" + exit 1 + fi echo "Would you like to edit the mailcow configuration? (y/N)" read -n1 -r