Christopher ec55c7e9b2 update-ubuntu-or-debian-server-script-overhaul (#47)
* feat: Implement comprehensive Ubuntu/Debian server update script

This commit introduces a major overhaul of the server update script, adding a wide range of new features and improvements:

- Adds support for configuration file to customize script behavior
- Implements detailed logging to both log file and JSON format
- Adds color and Unicode symbols for better visual appeal
- Tracks performance metrics and statistics during the update process
- Includes default configuration with various options to enable/disable features
- Adds helper functions for formatting and displaying content
- Checks for and installs missing dependencies (e.g., `bc` for calculations)
- Provides a decorative header with version information and branding
- Improves overall code structure and readability

These changes aim to make the script more user-friendly, configurable, and robust, providing a comprehensive solution for keeping Ubuntu and Debian servers up-to-date.

* feat(update-ubuntu-or-debian-server): Enhance README with new features and details

This commit significantly enhances the README file for the "update-ubuntu-or-debian-server" script. The key changes include:

- Added badges for license and last commit
- Expanded the table of contents with more detailed sections
- Provided a comprehensive overview of the script's features, including core functionality, safety and security, monitoring and reporting, and configuration management
- Detailed the prerequisites and automatic dependency installation
- Included quick start instructions for both basic usage and manual installation
- Documented the available command-line options
- Provided information about the configuration, system health checks, security features, performance monitoring, email notifications, automation and scheduling, file locations, advanced usage, troubleshooting, contributing, license, support, and version history

These changes aim to make the README more informative, user-friendly, and comprehensive, helping users better understand the capabilities and usage of the script.

* feat: Improve backup script and table of contents formatting

This commit includes the following changes:

1. Update the table of contents in the README.md file to remove the emoji
   prefixes and improve the formatting.

2. Modify the backup script (run.sh) to use a more robust method for
   capturing the package selections. Instead of using `dpkg --get-selections
   >`, the script now uses `sudo sh -c "dpkg --get-selections > ..."` to
   ensure proper file redirection.

3. Enhance the progress bar implementation in the backup script to use
   floating-point precision for the sleep interval, with a minimum value of
   0.05 seconds. This ensures a smoother progress display, even for short
   backup durations.

* feat(maintenance-window): Improve maintenance window handling

The changes in this commit improve the handling of the maintenance window
in the script. The previous implementation had issues with maintenance
windows that crossed midnight. The new implementation converts the times
to minutes since midnight and handles both the normal case (start <= end)
and the wrap-around case (start > end) correctly.

Additionally, the commit moves the "check_problematic_packages" function
call to before the package updates, ensuring that any problematic packages
are identified and excluded before the system is updated.

* feat(config): Safely parse configuration file

Implement a more secure way to load the configuration file by
parsing it line by line and only allowing known configuration
variables to be set. This prevents the execution of arbitrary
commands that could be present in the configuration file.

* feat(server-config): Update configuration variable handling

Modify the script to use `printf -v` to safely set configuration
variables and export them. This ensures that variables are properly
initialized and available for use throughout the script.

* feat(update-ubuntu-or-debian-server): Improve retry logic and progress reporting

The changes in this commit improve the retry logic and progress reporting in the `update-ubuntu-or-debian-server/run.sh` script. The key changes are:

- Refactor the `retry_operation` function to accept the command as an array, making it more flexible and easier to use.
- Update the `retry_operation` function to store the failed commands in the `FAILED_OPERATIONS` array.
- Improve the progress reporting by using the `show_progress_bar` function instead of `show_progress` for the package list update.
- Update the package upgrade and full upgrade steps to use the improved `retry_operation` function.
- Update the package autoremoval and cache cleanup steps to use the improved `retry_operation` function.

These changes aim to make the script more robust and provide better feedback to the user during the update process.

* feat(logging): Improve JSON logging with jq or manual escaping

The changes in this commit improve the JSON logging functionality in the
script. If the `jq` command is available, it is used to generate the JSON
log entries. If `jq` is not available, the script falls back to manual
escaping of the log message to ensure proper JSON formatting.

* feat: Use indirect variable expansion for config value

The changes update the way the script retrieves the configuration value
for auto-proceeding. Instead of using `eval echo`, it now uses indirect
variable expansion to directly access the value of the configuration
variable.
2025-06-30 15:54:05 -05:00
2023-10-04 21:27:05 -05:00
2023-08-14 21:39:57 -05:00
2023-10-27 11:00:31 -05:00

BigBearScripts

YouTube Link: https://www.youtube.com/@bigbeartechworld

BigBearCommunity

If you have a suggestion for a video, post in the BigBearCommunity.

Support My Work

ko-fi

Description
No description provided
Readme MIT 1 MiB
Languages
Shell 99.2%
JavaScript 0.8%