Este script fue desarrollado como un proyecto para la materia "Gestión de Sistemas Operativos" del Grado Superior en Administración de Sistemas Informáticos en Red (ASIR).
script_fbs.sh es un script de BASH diseñado para simplificar tareas administrativas comunes en sistemas Ubuntu y derivados de Debian. El script presenta un menú interactivo que permite a los usuarios realizar acciones complejas con una sola pulsación de tecla.
El objetivo es proporcionar una herramienta "todo en uno" para usuarios que prefieren un menú guiado en lugar de memorizar múltiples comandos.
- Gestión de usuarios y grupos: Crear usuarios, grupos y añadir usuarios a grupos.
- Gestión de paquetes: Instala programas automáticamente (como
samba,gedit,cowsay,ufw) solo si es necesario, gracias a una función de comprobación. - Archivos y carpetas: Crear, eliminar, copiar, listar, vincular, ver información y mostrar contenido de forma segura.
- Permisos: Asignar permisos comunes (propietario, grupo, todos).
- Firewall: Activar, desactivar y crear reglas simples con UFW.
- Sistema: Actualizar el sistema, ver el calendario, reiniciar la terminal y más.
- Clona el repositorio:
git clone [https://github.com/fedebsoria/easy-ubuntu-script.git](https://github.com/fedebsoria/easy-ubuntu-script.git) cd easy-ubuntu-script - Da permisos de ejecución al script:
chmod +x script_fbs.sh
- Ejecuta el script con
sudo(necesario para la mayoría de las tareas):sudo ./script_fbs.sh
This script was developed as a project for the "Operating Systems Management" course, part of the Advanced Diploma in Network Systems Administration (ASIR).
script_fbs.sh is a BASH script designed to simplify common administrative tasks on Ubuntu and Debian-based systems. The script provides an interactive menu that allows users to perform complex actions with a single keystroke.
The goal is to provide an "all-in-one" tool for users who prefer a guided menu over memorizing multiple commands.
- User & Group Management: Create users, groups, and add users to groups.
- Package Management: Automatically installs programs (like
samba,gedit,cowsay,ufw) only if they are missing, thanks to a built-in check function. - Files & Directories: Create, delete, copy, list, link, view info, and safely display file contents.
- Permissions: Assign common permissions (owner, group, all).
- Firewall: Enable, disable, and create simple rules with UFW.
- System: Update the system, view the calendar, restart the shell, and more.
- Clone the repository:
git clone [https://github.com/fedebsoria/easy-ubuntu-script.git](https://github.com/fedebsoria/easy-ubuntu-script.git) cd easy-ubuntu-script - Make the script executable:
chmod +x script_fbs.sh
- Run the script with
sudo(required for most tasks):sudo ./script_fbs.sh
This repository includes a tests/ folder for automated integrity checks.
test.sh: A BASH script used to test the script's non-interactive mode (e.g.,script_fbs.sh --ci) within a Linux environment.test.ps1: A PowerShell script designed to run tests from a Windows/PowerShell environment. This allows for testing the script's CI flags from a Windows machine without needing to open a local WSL instance.
Furthermore, this repository is configured with GitHub Actions to automatically run this test suite on every push and pull request, ensuring the script's core functionality remains stable and reliable.
- Propósito: Permite que el script se ejecute en un entorno automatizado, como CI/CD (Integración Continua) o un test.
- Acción:
- Imprime información básica del sistema (nombre del script, versión de BASH, sistema operativo).
exit 0: Esta es la parte más importante. Termina el script inmediatamente con un código de "éxito" (0).
- Resultado: Esto previene que el script continúe y muestre el menú interactivo, el cual "colgaría" un sistema de testing automatizado al esperar una entrada del usuario.
- Propósito: Una bandera estándar para mostrar la versión del script.
- Acción:
- Imprime el nombre del script y su número de versión.
- Termina el script inmediatamente.
- Propósito: Una bandera estándar para mostrar ayuda al usuario. (
-hes el atajo corto). - Acción:
- Imprime un mensaje de "Uso" que explica los comandos disponibles (ej.
Usage: $0 [--version] [--help]). exit 0: Termina el script inmediatamente.
- Imprime un mensaje de "Uso" que explica los comandos disponibles (ej.
- Purpose: Allows the script to be run in an automated environment, such as a CI/CD (Continuous Integration) pipeline or a test.
- Action:
- It prints basic system information (script name, BASH version, OS).
exit 0: This is the most important part. It immediately exits the script with a "success" code (0).
- Result: This prevents the script from continuing on to display the interactive menu, which would "hang" an automated testing system while it waits for human input.
- Purpose: A standard flag to display the script's version.
- Action:
- Prints the script's name and its version number (e.g.,
script_fbs.sh version 1.0). exit 0: Immediately exits the script.
- Prints the script's name and its version number (e.g.,
- Purpose: A standard flag to show help information to the user. (
-his the short alias). - Action:
- Prints a "Usage" message explaining the available commands (e.g.,
Usage: $0 [--version] [--help]). exit 0: Immediately exits the script.
- Prints a "Usage" message explaining the available commands (e.g.,