It is a advanced example of a Shell Script dialog for Ubuntu server.
sudo apt install dialog
sudo apt install zip
sudo apt install -y iptables
sudo apt install -y iptables-persistent
sudo apt install -y apache2
wget https://github.com/KeystoneDevBr/app_dialog.d/archive/refs/heads/main.zip
unzip main.zip
#Copy the app folder for your directory /etc/profile.d/
sudo mv app_dialog.d-main/ /etc/profile.d/app_dialog.d/
#Copy the start file for your directory /etc/profile.d/
sudo cp /etc/profile.d/app_dialog.d/dialog.sh /etc/profile.d/
#Check if the index.sh exists in the app folder
ls -la /etc/profile.d/app_dialog.d/dialog.d/index.sh
#Check if start file is is pointing correctly to index.sh file
sudo vim /etc/profile.d/dialog.sh
You neet see something like this
#!/bin/bash
#Start the dialog afet all user login
path_app="/etc/profile.d/app_dialog.d/dialog.d"
bash "$path_app/index.sh"
The struture the file needs to be like this:
/etc/profile.d/dialog.sh
/etc/profile.d/app_dialog.d/dialog.d/index.sh
/etc/profile.d/app_dialog.d/dialog.d/f_apache.sh
/etc/profile.d/app_dialog.d/dialog.d/f_config_ip.sh
/etc/profile.d/app_dialog.d/dialog.d/f_iptables.sh
/etc/profile.d/app_dialog.d/dialog.d/f_mysql.sh
/etc/profile.d/app_dialog.d/dialog.d/f_netplan_apply.sh
/etc/profile.d/app_dialog.d/dialog.d/f_vm_information.sh
sudo chown root.$USER -R /etc/profile.d/app_dialog.d/ /etc/profile.d/dialog.sh
sudo chmod 775 -R /etc/profile.d/dialog.sh /etc/profile.d/app_dialog.d/
Exit
ssh <cliente_name>@<server_address>