node and overview

This commit is contained in:
2025-02-28 08:56:55 +01:00
parent 42be50dca0
commit 5ae5b64798
2 changed files with 85 additions and 2 deletions
+46 -2
View File
@@ -111,9 +111,16 @@ install_nodejs() {
else
log_info "Node.js wird installiert..."
apt install -y curl
curl -fsSL https://deb.nodesource.com/setup_lts.x | bash -
# Using the latest LTS version (20.x as of now)
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
apt install -y nodejs
# Install latest npm version
npm install -g npm@latest
log_success "Node.js wurde erfolgreich installiert."
log_info "Installed Node.js version: $(node --version)"
log_info "Installed npm version: $(npm --version)"
fi
else
log_skip "Node.js-Installation übersprungen."
@@ -138,14 +145,51 @@ setup_basic_system() {
log_skip "Basic tools und UFW Installation übersprungen."
fi
}
# Function to display system overview
display_system_overview() {
log_info "=== System Overview ==="
echo -e "\n${BLUE}[Network Information]${NC}"
echo "IP Addresses:"
ip -4 addr show | grep inet | awk '{print $2}' | cut -d/ -f1
echo -e "\n${BLUE}[Disk Usage]${NC}"
df -h / | tail -n 1 | awk '{print "Root partition: " $4 " free of " $2}'
echo -e "\n${BLUE}[Memory Usage]${NC}"
free -h | awk '/^Mem:/ {print "RAM: " $3 " used of " $2 " total"}'
echo -e "\n${BLUE}[CPU Information]${NC}"
lscpu | grep "Model name" | cut -d: -f2- | sed 's/^[ \t]*//'
echo "CPU Usage: $(top -bn1 | grep "Cpu(s)" | awk '{print $2}')%"
echo -e "\n${BLUE}[Installed Components]${NC}"
if command_exists docker; then
echo "✓ Docker $(docker --version | cut -d' ' -f3 | tr -d ',')"
if docker ps | grep -q dockge; then
echo "✓ Dockge (running on port 5001)"
fi
fi
if command_exists node; then
echo "✓ Node.js $(node --version)"
fi
if command_exists ufw; then
echo "✓ UFW ($(ufw status | grep Status | cut -d' ' -f2))"
fi
echo -e "\n${BLUE}[Open Ports]${NC}"
netstat -tuln | grep LISTEN | awk '{print $4}' | sed 's/.*://'
echo -e "\n${GREEN}Setup completed! System is ready to use.${NC}\n"
}
# Main execution
main() {
setup_ssh
update_system
setup_basic_system # Replace both previous functions
setup_basic_system
install_docker
install_nodejs
display_system_overview
}
# Run main function