First working setup

This commit is contained in:
2024-08-07 07:09:31 +00:00
parent 0786dafbf0
commit f126adb197
5 changed files with 133 additions and 97 deletions

View File

@@ -1,8 +1,29 @@
#!/bin/bash
echo "Installing and setting up nginx"
./install_nginx.sh
echo "Installing and setting up Docker"
./install_docker.sh
echo "New user creation"
./create_user.sh
# Check for required arguments
if [ $# -ne 3 ]; then
echo "Usage: $0 <username> <server_ip> <port>"
exit 1
fi
# Extract arguments
username="$1"
server_ip="$2"
port="$3"
# Script path
script_path="index.sh"
# Transfer the script to the server
scp -P $port "$script_path" "$username@$server_ip:/tmp/" || {
echo "Error transferring script"
exit 1
}
# Execute the script on the server
ssh -P $port "$username@$server_ip" "bash /tmp/"$script_path"" || {
echo "Error executing script on server"
exit 1
}
echo "Script execution completed on $username@$server_ip"