Non-interactive installation?

I’m looking at non-interactive installation/upgrade/maintenance for my system. Is it possible to run the install script non-interactively by providing pre-seed values? I know re-installing picks up existing settings, so it should be possible to provide those for a fresh installation, but the install script will still prompt to confirm a handful of settings. Is it possible to skip those questions?

Thanks for your help.

I just started looking through bootstrap.sh, saw questions.sh and the first line contains a check for a NONINTERACTIVE var. I have some research to do…

The following worked for me.
Update variables as necessary.

#!/usr/bin/env bash

source /etc/mailinabox.conf
export $(cut -d= -f1 /etc/mailinabox.conf)

# export PRIMARY_HOSTNAME=box.miab.mail
# export PUBLIC_IP=127.0.0.1
# export PRIVATE_IP=127.0.0.1
# export PUBLIC_IPV6=::1
# export PRIVATE_IPV6=::1
# export STORAGE_USER=user-data
# export STORAGE_ROOT=/home/user-data
# export MTA_STS_MODE=enforce

export NONINTERACTIVE=1

sudo -u administrator curl -s https://mailinabox.email/setup.sh | sudo -E -u root bash

The source and export load the current configuration.
If you need to override any variables, you can do so by setting and exporting those after the initial load. (This also allowed me to better resolve an IPv6 issue I’ve had on Linode where the MiaB script picks up the wrong private address.)

I initially thought it’d be enough to just set NONINTERACTIVE and the other variables would get pulled from the existing configuration, but if the values aren’t set when questions.sh is run, the script forces interaction anyway.
Sourcing the configuration and exporting the values makes them available to the setup script and no interaction is necessary.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.