@bdacus01, thanks for encouragement
. Feedback on the forums helps us better understand what we can improve.
Part of confusion here might be a mixture of
custom-build
options vs
setup.sh
options.
Full list of
setup.sh
options are here, they are available:
Code:
# ./setup.sh --help
...
You may use the following environment variables to pre-define the settings:
DA_CHANNEL : Download channel: alpha, beta, current, stable, [commit-hash]
DA_EMAIL : Default email address
DA_HOSTNAME : Hostname to use for installation
DA_NS1 : pre-defined ns1
DA_NS2 : pre-defined ns2
Just set any of these environment variables to non-empty value (for example, DA_SKIP_CSF=true) to:
DA_SKIP_FASTEST : do not check for fastest server
DA_SKIP_CSF : skip installation of CFS firewall
DA_SKIP_MYSQL_INSTALL : skip installation of MySQL/MariaDB
DA_SKIP_SECURE_PHP : skip disabling insecure PHP functions automatically
DA_SKIP_CUSTOMBUILD : skip all the CustomBuild actions
DA_INTERACTIVE_CUSTOMBUILD : run interactive CustomBuild installation if DA_SKIP_CUSTOMBUILD is unset
...
Same ones are in the docs page.
However
custom-build
options are in lowercase and can be stored in a file (because there are a lot of them). You can find a full list of them in
/usr/local/directadmin/custombuild/options.conf
. And they tend to grow over time as
custom-build
starts to manage and install more software. That is part of the reason why they are not listed fully in the docs.
Regarding passing the variables to the script:
Code:
VAR1=aaa \
VAR2=bbb \
./myscript.sh
is identical to:
Code:
VAR1=aaa VAR2=bbb ./myscript.sh
Shell interpreter takes care of chomping new-lines escaped by
\
symbol and convert this command to single line. Thus there is no need for export keywords since we are actually setting variables for this particular script before execution like in single line mode.
You need to export them only if you want them survive in the current shell session. In other words to survive between multiple command executions.
One more thing about magic files controlling the installation. Before we started refreshing installation scripts same settings were available by creating magic files in root home:
/root/.use_hostname
- for setting custom hostname
/root/.email.txt
- for setting admin email
/root/.ns1.txt
and /root/.ns2.txt
- for setting NS servers
/root/.skip_get_license
- to skip license download step
/root/.skip_csf
- to skip CSF installation
/root/.using_fastest
- to skip fastest mirror detection
Files
/root/.preinstall
and
/root/.custombuild
is not used anymore.
They still do work (for backwards compatibility) but we really want to get rid of them and start using environment variables only. That is why docs do not mention it at all. And please switch to environment variables if you used files before. We will sooner or later drop support for magic files.
Key reasons for such decision:
- We do not pollute file system with stuff that is used only once
- We do not have to worry about formatting issues - for example hostname of the server being on second and not fist line of the file
- It is easier to document environment variables in the script usage page
- Environment variables are easier to integrate in other scripts and prevents