mirror of
https://github.com/elAgala/server-initializer.git
synced 2026-02-14 05:06:18 +00:00
Add update server before initializing | Fix var assignation issue
This commit is contained in:
13
index.sh
13
index.sh
@@ -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!"
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|||||||
Reference in New Issue
Block a user