I have a bash script with a series of whiptail menus that allows a user to setup their new system, which is Ubuntu server, with no GUI, just CLI (it's going to be a Virtual Machine image).
I'm already forcing a root login by editing
All interactive sessions of
bash will read the initialization file
So you can just add the script at the end of the
/root/.bashrc, assuming the script is executable:
echo '/path/to/whiptail.sh' >>/root/.bashrc
Now the script will be always run when
root opens a new interactive shell. If you only want to run while login only, not all all interactive sessions you should rather use
~/.profile (the first one available following the order).