-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathserver_config
38 lines (26 loc) · 1.09 KB
/
server_config
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
# Obtener la configuración de red
echo "$(tput setaf 1)[$(tput setaf 3)*$(tput setaf 1)]$(tput setaf 6)Obteniendo la configuración de red..."
ip a > network_config.txt
sleep 1
# Obtener la configuración de sistema
echo "$(tput setaf 1)[$(tput setaf 3)*$(tput setaf 1)]$(tput setaf 6)bteniendo la configuración de sistema..."
uname -a > system_config.txt
cat /proc/cpuinfo >> system_config.txt
cat /proc/meminfo >> system_config.txt
lscpu >> system_config.txt
lsblk >> system_config.txt
df -h >> system_config.txt
sleep 1
# Comprimir los archivos en un archivo .zip
echo "$(tput setaf 1)[$(tput setaf 3)*$(tput setaf 1)]$(tput setaf 6)Comprimiendo los archivos..."
zip config_files.zip network_config.txt system_config.txt
sleep 1
# Eliminar los archivos de texto
echo "$(tput setaf 1)[$(tput setaf 3)*$(tput setaf 1)]$(tput setaf 6)Eliminando los archivos de texto..."
rm network_config.txt system_config.txt
sleep 1
echo "La configuración de red y de sistema ha sido guardada en el archivo config_files.zip, en la carpeta report."
mkdir report
mv config_files.zip report/
tput sgr0