Write a bash script for Ubuntu
It is necessary to write a bash script for Ubuntu 22.04 that should run on a clean OS and perform the following tasks without user involvement:
Initial conditions: the user uploads text files with data on domains, mailboxes, and IPs to /root:
- domains.txt - a list of domain names that need to be registered on the server, as well as the IP for each domain.
- mailbox.txt - a list of mailboxes that need to be created for each domain.
- mailpass.txt - the password for the created mailboxes.
- site.zip - an archive whose contents need to be unpacked to the root of each domain.
Task of the script:
- Register the domains on the server with their IPs. Unpack the zip archive to the root of each domain.
- Generate SSL certificates for each domain to work through the HTTPS protocol.
- Create the necessary mailboxes on behalf of each domain from the mailbox.txt list and with the password from mailpass.txt
- Generate private and public DKIM keys for each domain (for this task, there is already an example of a separate bash script that generates keys and creates separate txt files for each domain for each private and public key). You can use this ready-made bash, or integrate it into a single bash script, or write it separately.
- Install and configure a mail SMTP server based on exim (or any other) that can send mail.
- Install a mail client to access any mailbox (for example, Roundcube, or any other that allows browser access through authorization to check incoming mail).
- Install the MySQL database server.
P.S> There is already a separate bash script for creating and making necessary records in DNS for working with DNSmanager from ISPsystem.
Final result of the execution: each domain opens in the browser via https and displays the contents of the unpacked zip archive. It is possible to log in to the mail client at a separate address and check the contents of the selected mailbox. The ability to send mail on behalf of any mailbox when connecting to SMTP through an external mail program.
IMPORTANT: after starting, the script must run automatically without further user involvement. That is, there should be no dialogs like "If you want this - click here". That is, if the installation of some module is taking place, it should happen automatically without additional user intervention.
Work through "safe" and only with the direct performer without intermediaries (companies, teams, etc.)
Please indicate the budget and deadlines in your proposals immediately.
-
mailbox.txt Тут список емейлів (логінів?).
Коли створюється один користувач, то який йому пароль з іншого файлу вибирати: такий же по послідовності чи рандомний з файлу?
ЯКщо рандомний, то як вам тоді повідомляти повинна система, який саме пароль був встановлений?
-