From 7999b9ad79a5aba6b12be73a938c823fc5b329e8 Mon Sep 17 00:00:00 2001 From: Spacedio Date: Sun, 24 May 2026 21:07:04 -0400 Subject: Reorganization of files. --- system/usr/system-update | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100755 system/usr/system-update (limited to 'system/usr/system-update') diff --git a/system/usr/system-update b/system/usr/system-update new file mode 100755 index 0000000..4187e46 --- /dev/null +++ b/system/usr/system-update @@ -0,0 +1,36 @@ +#!/bin/bash +# /usr/local/bin/sys-update +# Formal system maintenance utility with administrative enforcement + +LOG_FILE="/var/log/system-update.log" + +# Administrative Privileges Check +if [ "$EUID" -ne 0 ]; then + printf ":: [ERROR] This utility requires administrative privileges. Please execute with 'sudo'.\n" >&2 + exit 1 +fi + +set -e + +log_message() { + printf "[$(date +'%Y-%m-%d %H:%M:%S')] %s\n" "$1" >> "$LOG_FILE" +} + +log_message "START: Commencing system maintenance cycle." +printf ":: Initializing hardware state: Activating discrete GPU...\n" +gpu-toggle on + +printf ":: Synchronizing package repositories and performing system upgrade...\n" +xbps-install -Su + +printf ":: Commencing filesystem optimization and orphan removal...\n" +xbps-remove -Oo + +printf ":: Executing kernel image purge for obsolete versions...\n" +vkpurge rm all + +printf ":: Restoring power-efficient state: Deactivating discrete GPU...\n" +gpu-toggle off + +log_message "FINISH: Maintenance cycle completed successfully." +printf ":: [SUCCESS] Operation logged to %s\n" "$LOG_FILE" -- cgit v1.2.3