Created
August 2, 2023 20:12
-
-
Save Segmentational/fb555d1cc5643f35e944d8ba94a2332e to your computer and use it in GitHub Desktop.
Fedora, CentOS, Security Update Script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash --posix | |
# -*- Coding: UTF-8 -*- # | |
# -*- System: Linux -*- # | |
# -*- Usage: *.* -*- # | |
# See Bash Set-Options Reference Below | |
set -euo pipefail # (0) | |
set -o xtrace # (6) | |
function Main() { | |
yum install yum-plugin-security | |
# All Available Erratas - No Installation | |
yum updateinfo list available | |
# All Available Security Updates - No Installation | |
yum updateinfo list security all | |
yum updateinfo list sec | |
# Verbose Information Around Individual Security Updates - No Installation | |
yum info-sec | |
# Download and Apply all Available Security Updates | |
# - NOTE: It will install the last version available of any package with at least one security | |
# errata thus can install non-security erratas if they provide a more updated version of the package. | |
# yum -y update --security | |
# Only Install Packages that Contain Security Errata | |
yum update-minimal --security -y | |
} | |
Main | |
# -------------------------------------------------------------------------------- | |
# Bash Set-Options Reference | |
# - https://tldp.org/LDP/abs/html/options.html | |
# -------------------------------------------------------------------------------- | |
# 0. An Opinionated, Well Agreed Upon Standard for Bash Script Execution | |
# 1. set -o verbose ::: Print Shell Input upon Read | |
# 2. set -o allexport ::: Export all Variable(s) + Function(s) to Environment | |
# 3. set -o errexit ::: Exit Immediately upon Pipeline'd Failure | |
# 4. set -o monitor ::: Output Process-Separated Command(s) | |
# 5. set -o privileged ::: Ignore Externals - Ensures of Pristine Run Environment | |
# 6. set -o xtrace ::: Print a Trace of Simple Commands | |
# 7. set -o braceexpand ::: Enable Brace Expansion | |
# 8. set -o no-exec ::: Bash Syntax Debugging |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment