Update rhel8-iso-update.sh
This commit is contained in:
@@ -2,13 +2,47 @@
|
|||||||
|
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
# RHEL 8.10 Offline Update Script
|
# RHEL 8.10 Offline Update Script
|
||||||
#
|
#===============================================================================
|
||||||
# This interactive script guides administrators through applying updates
|
#
|
||||||
# from a locally-mounted ISO file.
|
# DESCRIPTION
|
||||||
|
# Interactive script for applying RHEL 8.10 updates from a local ISO file
|
||||||
|
# in air-gapped or disconnected environments.
|
||||||
|
#
|
||||||
|
# SUPPORTED ISOs
|
||||||
|
# - Full_Latest_RHEL8_x86_64_patches_*.iso (full monthly update, ~30GB)
|
||||||
|
# - Incremental_Latest_RHEL8_X86_64_patches_*.iso (incremental update, smaller)
|
||||||
|
#
|
||||||
|
# USAGE
|
||||||
|
# sudo ./rhel8-iso-update.sh
|
||||||
|
#
|
||||||
|
# OPTIONS
|
||||||
|
# The script is fully interactive and will prompt for all choices.
|
||||||
|
# No command-line arguments are required.
|
||||||
|
#
|
||||||
|
# FEATURES
|
||||||
|
# - Auto-detects ISOs in /var/isos/, /media/, /mnt/, and USB drives
|
||||||
|
# - Detects and can mount unmounted USB devices
|
||||||
|
# - Cleans up previous update configuration before applying new updates
|
||||||
|
# - Creates temporary repo pointing to mounted ISO
|
||||||
|
# - Checks if reboot is required after updates
|
||||||
|
# - Optional cleanup of ISO, mount, and repo files when finished
|
||||||
|
#
|
||||||
|
# PATHS USED
|
||||||
|
# ISO Search: /var/isos/, /run/media/, /media/, /mnt/
|
||||||
|
# Mount Point: /media/rhel-patches
|
||||||
|
# Repo File: /etc/yum.repos.d/rhel-patches.repo
|
||||||
|
#
|
||||||
|
# REQUIREMENTS
|
||||||
|
# - Root or sudo access
|
||||||
|
# - RHEL 8.10 system
|
||||||
|
# - Sufficient disk space (~35GB for full ISO if copying locally)
|
||||||
|
#
|
||||||
|
# AUTHOR
|
||||||
|
# Cybersecurity Team
|
||||||
|
#
|
||||||
|
# LAST UPDATED
|
||||||
|
# January 2026
|
||||||
#
|
#
|
||||||
# ISO: Full_Latest_RHEL8_x86_64_patches_2026-01-13.iso
|
|
||||||
# Mount Point: /media/JanPatch
|
|
||||||
# Repo File: /etc/yum.repos.d/JanPatch.repo
|
|
||||||
#===============================================================================
|
#===============================================================================
|
||||||
|
|
||||||
# Colors for output
|
# Colors for output
|
||||||
@@ -19,10 +53,13 @@ BLUE='\033[0;34m'
|
|||||||
NC='\033[0m' # No Color
|
NC='\033[0m' # No Color
|
||||||
|
|
||||||
# Configuration
|
# Configuration
|
||||||
ISO_NAME="Full_Latest_RHEL8_x86_64_patches_2026-01-13.iso"
|
ISO_PATTERN_FULL="Full_Latest_RHEL8_x86_64_patches_*.iso"
|
||||||
ISO_PATH="/var/isos/${ISO_NAME}"
|
ISO_PATTERN_INCREMENTAL="Incremental_Latest_RHEL8_X86_64_patches_*.iso"
|
||||||
MOUNT_POINT="/media/JanPatch"
|
ISO_NAME="" # Will be set when ISO is found/selected
|
||||||
REPO_FILE="/etc/yum.repos.d/JanPatch.repo"
|
ISO_PATH="" # Will be set when ISO is found/selected
|
||||||
|
ISO_DIR="/var/isos"
|
||||||
|
MOUNT_POINT="/media/rhel-patches"
|
||||||
|
REPO_FILE="/etc/yum.repos.d/rhel-patches.repo"
|
||||||
|
|
||||||
# Global variables for tracking
|
# Global variables for tracking
|
||||||
FOUND_ISO_LOCATIONS=()
|
FOUND_ISO_LOCATIONS=()
|
||||||
@@ -87,6 +124,62 @@ check_root() {
|
|||||||
# ISO Detection Functions
|
# ISO Detection Functions
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
check_previous_update() {
|
||||||
|
# Check if there's a previous update still mounted/configured
|
||||||
|
local needs_cleanup=false
|
||||||
|
|
||||||
|
if mountpoint -q "$MOUNT_POINT" 2>/dev/null; then
|
||||||
|
needs_cleanup=true
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -f "$REPO_FILE" ]]; then
|
||||||
|
needs_cleanup=true
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "$needs_cleanup" == true ]]; then
|
||||||
|
print_header "Previous Update Detected"
|
||||||
|
echo "A previous update configuration was found:"
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
if mountpoint -q "$MOUNT_POINT" 2>/dev/null; then
|
||||||
|
echo " - ISO mounted at: ${MOUNT_POINT}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -f "$REPO_FILE" ]]; then
|
||||||
|
echo " - Repo file exists: ${REPO_FILE}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
if confirm_action "Would you like to clean up the previous update before continuing?"; then
|
||||||
|
print_info "Cleaning up previous update..."
|
||||||
|
|
||||||
|
# Disable repo if it exists
|
||||||
|
if [[ -f "$REPO_FILE" ]]; then
|
||||||
|
dnf config-manager --set-disabled dvd-rhel-patches 2>/dev/null
|
||||||
|
rm -f "$REPO_FILE"
|
||||||
|
print_success "Removed old repo file."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Unmount if mounted
|
||||||
|
if mountpoint -q "$MOUNT_POINT" 2>/dev/null; then
|
||||||
|
umount "$MOUNT_POINT"
|
||||||
|
print_success "Unmounted previous ISO."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Clean DNF cache
|
||||||
|
dnf clean all &>/dev/null
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
print_success "Previous update cleaned up."
|
||||||
|
else
|
||||||
|
print_info "Keeping previous configuration. The script will overwrite as needed."
|
||||||
|
fi
|
||||||
|
|
||||||
|
pause_continue
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
detect_external_media() {
|
detect_external_media() {
|
||||||
# Find mounted external media (USB drives, external disks)
|
# Find mounted external media (USB drives, external disks)
|
||||||
# Looks in common mount locations for removable media
|
# Looks in common mount locations for removable media
|
||||||
@@ -96,22 +189,29 @@ detect_external_media() {
|
|||||||
"/run/media"
|
"/run/media"
|
||||||
"/media"
|
"/media"
|
||||||
"/mnt"
|
"/mnt"
|
||||||
|
"$ISO_DIR"
|
||||||
)
|
)
|
||||||
|
|
||||||
print_info "Scanning for external media..."
|
print_info "Scanning for RHEL patch ISOs (Full and Incremental)..."
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
for base_path in "${search_paths[@]}"; do
|
for base_path in "${search_paths[@]}"; do
|
||||||
if [[ -d "$base_path" ]]; then
|
if [[ -d "$base_path" ]]; then
|
||||||
# Find the ISO file recursively in media locations
|
# Find Full ISO files
|
||||||
while IFS= read -r -d '' file; do
|
while IFS= read -r -d '' file; do
|
||||||
found_locations+=("$file")
|
found_locations+=("$file")
|
||||||
done < <(find "$base_path" -maxdepth 3 -name "$ISO_NAME" -type f -print0 2>/dev/null)
|
done < <(find "$base_path" -maxdepth 3 -name "$ISO_PATTERN_FULL" -type f -print0 2>/dev/null)
|
||||||
|
|
||||||
|
# Find Incremental ISO files
|
||||||
|
while IFS= read -r -d '' file; do
|
||||||
|
found_locations+=("$file")
|
||||||
|
done < <(find "$base_path" -maxdepth 3 -name "$ISO_PATTERN_INCREMENTAL" -type f -print0 2>/dev/null)
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# Return results via global variable
|
# Sort by filename (newest date typically last)
|
||||||
FOUND_ISO_LOCATIONS=("${found_locations[@]}")
|
IFS=$'\n' FOUND_ISO_LOCATIONS=($(sort -u <<< "${found_locations[*]}")); unset IFS
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
detect_unmounted_usb() {
|
detect_unmounted_usb() {
|
||||||
@@ -151,21 +251,25 @@ show_iso_search_menu() {
|
|||||||
local option_paths=()
|
local option_paths=()
|
||||||
local count=1
|
local count=1
|
||||||
|
|
||||||
echo "Where would you like to load the ISO from?"
|
echo "Found the following RHEL patch ISO files:"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
# Option: Default location if exists
|
# Options: Found ISO files
|
||||||
if [[ -f "$ISO_PATH" ]]; then
|
|
||||||
echo " ${count}) Default location: ${ISO_PATH}"
|
|
||||||
options+=("default")
|
|
||||||
option_paths+=("$ISO_PATH")
|
|
||||||
((count++))
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Options: Found on external media
|
|
||||||
for location in "${FOUND_ISO_LOCATIONS[@]}"; do
|
for location in "${FOUND_ISO_LOCATIONS[@]}"; do
|
||||||
echo " ${count}) External media: ${location}"
|
local filename=$(basename "$location")
|
||||||
options+=("external")
|
local dir=$(dirname "$location")
|
||||||
|
local iso_type="Unknown"
|
||||||
|
|
||||||
|
# Determine ISO type
|
||||||
|
if [[ "$filename" == Full_* ]]; then
|
||||||
|
iso_type="Full"
|
||||||
|
elif [[ "$filename" == Incremental_* ]]; then
|
||||||
|
iso_type="Incremental"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo " ${count}) [${iso_type}] ${filename}"
|
||||||
|
echo " Location: ${dir}"
|
||||||
|
options+=("found")
|
||||||
option_paths+=("$location")
|
option_paths+=("$location")
|
||||||
((count++))
|
((count++))
|
||||||
done
|
done
|
||||||
@@ -208,8 +312,9 @@ show_iso_search_menu() {
|
|||||||
local chosen_path="${option_paths[$idx]}"
|
local chosen_path="${option_paths[$idx]}"
|
||||||
|
|
||||||
case "$chosen_option" in
|
case "$chosen_option" in
|
||||||
"default"|"external")
|
"found")
|
||||||
ISO_PATH="$chosen_path"
|
ISO_PATH="$chosen_path"
|
||||||
|
ISO_NAME=$(basename "$ISO_PATH")
|
||||||
return 0
|
return 0
|
||||||
;;
|
;;
|
||||||
"mount_usb")
|
"mount_usb")
|
||||||
@@ -220,6 +325,7 @@ show_iso_search_menu() {
|
|||||||
read -p "Enter full path to ISO file: " custom_path
|
read -p "Enter full path to ISO file: " custom_path
|
||||||
if [[ -f "$custom_path" ]]; then
|
if [[ -f "$custom_path" ]]; then
|
||||||
ISO_PATH="$custom_path"
|
ISO_PATH="$custom_path"
|
||||||
|
ISO_NAME=$(basename "$ISO_PATH")
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
print_error "File not found: ${custom_path}"
|
print_error "File not found: ${custom_path}"
|
||||||
@@ -244,27 +350,29 @@ mount_usb_device() {
|
|||||||
if mount "$device" "$mount_dir"; then
|
if mount "$device" "$mount_dir"; then
|
||||||
print_success "Mounted ${device} to ${mount_dir}"
|
print_success "Mounted ${device} to ${mount_dir}"
|
||||||
|
|
||||||
# Search for ISO on mounted device
|
# Search for ISO on mounted device using both patterns
|
||||||
local found_iso=$(find "$mount_dir" -maxdepth 2 -name "$ISO_NAME" -type f 2>/dev/null | head -1)
|
local found_iso=$(find "$mount_dir" -maxdepth 2 \( -name "$ISO_PATTERN_FULL" -o -name "$ISO_PATTERN_INCREMENTAL" \) -type f 2>/dev/null | head -1)
|
||||||
|
|
||||||
if [[ -n "$found_iso" ]]; then
|
if [[ -n "$found_iso" ]]; then
|
||||||
print_success "Found ISO: ${found_iso}"
|
print_success "Found ISO: ${found_iso}"
|
||||||
|
ISO_NAME=$(basename "$found_iso")
|
||||||
|
|
||||||
if confirm_action "Copy ISO to ${ISO_PATH}? (This will take several minutes for 30GB)"; then
|
if confirm_action "Copy ISO to ${ISO_DIR}/${ISO_NAME}? (This will take several minutes for large ISOs)"; then
|
||||||
print_info "Copying ISO... This may take a while."
|
print_info "Copying ISO... This may take a while."
|
||||||
|
|
||||||
# Ensure target directory exists
|
# Ensure target directory exists
|
||||||
mkdir -p "$(dirname "$ISO_PATH")"
|
mkdir -p "$ISO_DIR"
|
||||||
|
|
||||||
# Copy with progress using rsync if available, otherwise cp
|
# Copy with progress using rsync if available, otherwise cp
|
||||||
if command -v rsync &>/dev/null; then
|
if command -v rsync &>/dev/null; then
|
||||||
rsync -ah --progress "$found_iso" "$ISO_PATH"
|
rsync -ah --progress "$found_iso" "${ISO_DIR}/${ISO_NAME}"
|
||||||
else
|
else
|
||||||
cp -v "$found_iso" "$ISO_PATH"
|
cp -v "$found_iso" "${ISO_DIR}/${ISO_NAME}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -f "$ISO_PATH" ]]; then
|
if [[ -f "${ISO_DIR}/${ISO_NAME}" ]]; then
|
||||||
print_success "ISO copied successfully."
|
print_success "ISO copied successfully."
|
||||||
|
ISO_PATH="${ISO_DIR}/${ISO_NAME}"
|
||||||
umount "$mount_dir"
|
umount "$mount_dir"
|
||||||
rmdir "$mount_dir"
|
rmdir "$mount_dir"
|
||||||
return 0
|
return 0
|
||||||
@@ -279,7 +387,11 @@ mount_usb_device() {
|
|||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
print_error "ISO file not found on ${device}"
|
print_error "No RHEL patch ISO found on ${device}"
|
||||||
|
echo "Looking for files matching:"
|
||||||
|
echo " - ${ISO_PATTERN_FULL}"
|
||||||
|
echo " - ${ISO_PATTERN_INCREMENTAL}"
|
||||||
|
echo ""
|
||||||
echo "Files on device:"
|
echo "Files on device:"
|
||||||
ls -la "$mount_dir" | head -10
|
ls -la "$mount_dir" | head -10
|
||||||
fi
|
fi
|
||||||
@@ -301,14 +413,17 @@ mount_usb_device() {
|
|||||||
show_welcome() {
|
show_welcome() {
|
||||||
clear
|
clear
|
||||||
print_header "RHEL 8.10 Offline Update Script"
|
print_header "RHEL 8.10 Offline Update Script"
|
||||||
echo "This script will guide you through applying updates from the ISO file:"
|
echo "This script will guide you through applying updates from a patch ISO."
|
||||||
echo ""
|
echo ""
|
||||||
echo " ISO File: ${ISO_NAME}"
|
echo " Supported ISOs:"
|
||||||
echo " Mount Point: ${MOUNT_POINT}"
|
echo " - Full: ${ISO_PATTERN_FULL}"
|
||||||
echo " Repo File: ${REPO_FILE}"
|
echo " - Incremental: ${ISO_PATTERN_INCREMENTAL}"
|
||||||
|
echo ""
|
||||||
|
echo " Mount Point: ${MOUNT_POINT}"
|
||||||
|
echo " Repo File: ${REPO_FILE}"
|
||||||
echo ""
|
echo ""
|
||||||
echo "Steps this script will perform:"
|
echo "Steps this script will perform:"
|
||||||
echo " 1. Verify the ISO file exists"
|
echo " 1. Search for and select the ISO file"
|
||||||
echo " 2. Create mount point and mount the ISO"
|
echo " 2. Create mount point and mount the ISO"
|
||||||
echo " 3. Create the local repository configuration"
|
echo " 3. Create the local repository configuration"
|
||||||
echo " 4. Refresh the package cache"
|
echo " 4. Refresh the package cache"
|
||||||
@@ -326,47 +441,56 @@ show_welcome() {
|
|||||||
|
|
||||||
step1_verify_iso() {
|
step1_verify_iso() {
|
||||||
print_header "Step 1: Locate ISO File"
|
print_header "Step 1: Locate ISO File"
|
||||||
print_step "1" "Searching for ISO file..."
|
print_step "1" "Searching for RHEL patch ISO files..."
|
||||||
|
|
||||||
# Detect external media with ISO
|
# Detect ISOs in all locations
|
||||||
detect_external_media
|
detect_external_media
|
||||||
detect_unmounted_usb
|
detect_unmounted_usb
|
||||||
|
|
||||||
# Check if ISO exists in default location
|
# Check if any ISOs were found
|
||||||
local iso_found=false
|
|
||||||
if [[ -f "$ISO_PATH" ]]; then
|
|
||||||
iso_found=true
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Check if found on external media
|
|
||||||
if [[ ${#FOUND_ISO_LOCATIONS[@]} -gt 0 ]]; then
|
if [[ ${#FOUND_ISO_LOCATIONS[@]} -gt 0 ]]; then
|
||||||
iso_found=true
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Show what we found
|
|
||||||
if [[ "$iso_found" == true ]] || [[ ${#UNMOUNTED_USB_DEVICES[@]} -gt 0 ]]; then
|
|
||||||
|
|
||||||
# If only one option (default location) and no USB, use it directly
|
# If only one ISO found, confirm and use it
|
||||||
if [[ -f "$ISO_PATH" ]] && [[ ${#FOUND_ISO_LOCATIONS[@]} -eq 0 ]] && [[ ${#UNMOUNTED_USB_DEVICES[@]} -eq 0 ]]; then
|
if [[ ${#FOUND_ISO_LOCATIONS[@]} -eq 1 ]] && [[ ${#UNMOUNTED_USB_DEVICES[@]} -eq 0 ]]; then
|
||||||
print_success "ISO file found: ${ISO_PATH}"
|
ISO_PATH="${FOUND_ISO_LOCATIONS[0]}"
|
||||||
|
ISO_NAME=$(basename "$ISO_PATH")
|
||||||
|
print_success "Found ISO: ${ISO_NAME}"
|
||||||
|
print_info "Location: $(dirname "$ISO_PATH")"
|
||||||
|
|
||||||
local size=$(du -h "$ISO_PATH" | cut -f1)
|
local size=$(du -h "$ISO_PATH" | cut -f1)
|
||||||
print_info "File size: ${size}"
|
print_info "File size: ${size}"
|
||||||
|
|
||||||
|
if ! confirm_action "Use this ISO?"; then
|
||||||
|
if ! show_iso_search_menu; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
# Multiple options available - show menu
|
# Multiple options - show menu
|
||||||
if ! show_iso_search_menu; then
|
if ! show_iso_search_menu; then
|
||||||
print_error "Failed to locate ISO file."
|
print_error "Failed to locate ISO file."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
print_success "Using ISO: ${ISO_PATH}"
|
fi
|
||||||
|
|
||||||
|
print_success "Selected: ${ISO_NAME}"
|
||||||
|
|
||||||
|
elif [[ ${#UNMOUNTED_USB_DEVICES[@]} -gt 0 ]]; then
|
||||||
|
# No ISOs found but unmounted USB detected
|
||||||
|
print_info "No ISO files found, but unmounted USB devices detected."
|
||||||
|
if ! show_iso_search_menu; then
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
# Nothing found anywhere
|
# Nothing found anywhere
|
||||||
print_error "ISO file not found."
|
print_error "No RHEL patch ISO files found."
|
||||||
echo ""
|
echo ""
|
||||||
echo "The script searched for: ${ISO_NAME}"
|
echo "The script searched for:"
|
||||||
|
echo " - ${ISO_PATTERN_FULL}"
|
||||||
|
echo " - ${ISO_PATTERN_INCREMENTAL}"
|
||||||
echo ""
|
echo ""
|
||||||
echo "Locations checked:"
|
echo "Locations checked:"
|
||||||
echo " - ${ISO_PATH}"
|
echo " - ${ISO_DIR}/"
|
||||||
echo " - /run/media/*/ (mounted USB drives)"
|
echo " - /run/media/*/ (mounted USB drives)"
|
||||||
echo " - /media/*/"
|
echo " - /media/*/"
|
||||||
echo " - /mnt/*/"
|
echo " - /mnt/*/"
|
||||||
@@ -376,17 +500,15 @@ step1_verify_iso() {
|
|||||||
read -p "Enter full path to ISO file: " custom_path
|
read -p "Enter full path to ISO file: " custom_path
|
||||||
if [[ -f "$custom_path" ]]; then
|
if [[ -f "$custom_path" ]]; then
|
||||||
ISO_PATH="$custom_path"
|
ISO_PATH="$custom_path"
|
||||||
print_success "Using ISO: ${ISO_PATH}"
|
ISO_NAME=$(basename "$ISO_PATH")
|
||||||
|
print_success "Using ISO: ${ISO_NAME}"
|
||||||
else
|
else
|
||||||
print_error "File not found: ${custom_path}"
|
print_error "File not found: ${custom_path}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
echo ""
|
echo ""
|
||||||
echo "Please copy the ISO to /var/isos/ and run this script again."
|
echo "Please copy the ISO to ${ISO_DIR}/ and run this script again."
|
||||||
echo ""
|
|
||||||
echo "Example from USB drive:"
|
|
||||||
echo " cp /run/media/\$(whoami)/USBDRIVE/${ISO_NAME} /var/isos/"
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@@ -460,10 +582,10 @@ step3_create_repo() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Create the repo file
|
# Create the repo file
|
||||||
cat > "$REPO_FILE" << 'EOF'
|
cat > "$REPO_FILE" << EOF
|
||||||
[dvd-rhel-patches]
|
[dvd-rhel-patches]
|
||||||
name=DVD for RHEL Patches
|
name=DVD for RHEL Patches
|
||||||
baseurl=file:///media/JanPatch
|
baseurl=file://${MOUNT_POINT}
|
||||||
enabled=1
|
enabled=1
|
||||||
gpgcheck=0
|
gpgcheck=0
|
||||||
EOF
|
EOF
|
||||||
@@ -611,10 +733,10 @@ step8_cleanup() {
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Delete ISO (only if it's in /var/isos, not on USB)
|
# Delete ISO (only if it's in ISO_DIR, not on USB)
|
||||||
if [[ -f "/var/isos/$ISO_NAME" ]]; then
|
if [[ -n "$ISO_NAME" ]] && [[ -f "${ISO_DIR}/${ISO_NAME}" ]]; then
|
||||||
if confirm_action "Delete the ISO file (/var/isos/${ISO_NAME})? This will free up ~30GB."; then
|
if confirm_action "Delete the ISO file (${ISO_DIR}/${ISO_NAME})? This will free up ~30GB."; then
|
||||||
rm -f "/var/isos/$ISO_NAME"
|
rm -f "${ISO_DIR}/${ISO_NAME}"
|
||||||
print_success "ISO file deleted."
|
print_success "ISO file deleted."
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@@ -650,6 +772,7 @@ show_complete() {
|
|||||||
main() {
|
main() {
|
||||||
check_root
|
check_root
|
||||||
show_welcome
|
show_welcome
|
||||||
|
check_previous_update
|
||||||
step1_verify_iso
|
step1_verify_iso
|
||||||
step2_mount_iso
|
step2_mount_iso
|
||||||
step3_create_repo
|
step3_create_repo
|
||||||
@@ -662,4 +785,4 @@ main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Run main function
|
# Run main function
|
||||||
main
|
main
|
||||||
Reference in New Issue
Block a user