Add update server before initializing | Fix var assignation issue

This commit is contained in:
2025-01-23 21:51:09 -03:00
parent feb4056a84
commit c08b6d393e
5 changed files with 15 additions and 8 deletions

View File

@@ -10,11 +10,18 @@ fi
cd "$TARGET_DIR" || exit 1 cd "$TARGET_DIR" || exit 1
echo "Running install.sh from the cloned repository..." echo "[ INITIALIZER ]: Starting initialization"
echo "[ INITIALIZER ]: Updating server"
sudo apt update && sudo apt upgrade -y && sudo apt dist-upgrade -y && sudo apt autoremove -y
echo "[ INITIALIZER ]: Server updated. Starting set up"
chmod +x ./install.sh chmod +x ./install.sh
./install.sh "$1" ./install.sh "$1"
echo "Cleaning up..." echo "[ INITIALIZER ]: Setup completed succesfully!"
echo "[ INITIALIZER ]: Cleaning up"
cd / cd /
rm -rf "$TARGET_DIR" rm -rf "$TARGET_DIR"
echo "Cleanup complete!" echo "[ INITIALIZER ]: Success!"

View File

@@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
function install_prometehus() { function install_prometehus() {
REPO_URL = "https://raw.githubusercontent.com/elAgala/monitoring-template/main" REPO_URL="https://raw.githubusercontent.com/elAgala/monitoring-template/main"
username="$1" username="$1"
monitoring_dir="/home/$username/monitoring" monitoring_dir="/home/$username/monitoring"

View File

@@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
function create_user() { function create_user() {
username = $1 username=$1
echo "[ USER ]: Starting user setup" echo "[ USER ]: Starting user setup"
sudo useradd $username sudo useradd $username

View File

@@ -1,10 +1,10 @@
#!/bin/bash #!/bin/bash
function config_ssh() { function config_ssh() {
username = $1 username=$1
echo "[ SSH ]: Starting setup" echo "[ SSH ]: Starting setup"
ssh_dir = "/home/$username/.ssh" ssh_dir="/home/$username/.ssh"
sudo mkdir -p $ssh_dir sudo mkdir -p $ssh_dir
sudo chmod 700 $ssh_dir sudo chmod 700 $ssh_dir

View File

@@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
function install_zsh() { function install_zsh() {
username = $1 username=$1
echo "[ UTILS ]: Installing zsh" echo "[ UTILS ]: Installing zsh"
sudo apt-get install -y zsh sudo apt-get install -y zsh
sudo chsh -s /usr/bin/zsh "$username" sudo chsh -s /usr/bin/zsh "$username"