mirror of
https://github.com/Snigdha-OS/snigdhaos-system-installation.git
synced 2025-09-20 21:44:55 +02:00
64 lines
1.6 KiB
Bash
Executable File
64 lines
1.6 KiB
Bash
Executable File
#!/bin/bash
|
|
# set -e
|
|
|
|
# Author : Eshan Roy <eshan@snigdhaos.or>
|
|
# Author URL : https://eshanized.github.io/
|
|
|
|
# Function to log messages
|
|
log_message() {
|
|
echo "[INFO] $1"
|
|
}
|
|
|
|
# Function to log error messages
|
|
log_error() {
|
|
echo "[ERROR] $1" >&2
|
|
}
|
|
|
|
# Function to check for sudo privileges
|
|
check_sudo() {
|
|
if ! sudo -v &>/dev/null; then
|
|
log_error "You need to have sudo privileges to run this script."
|
|
exit 1
|
|
fi
|
|
}
|
|
|
|
# Main Execution
|
|
log_message "Starting Execution..."
|
|
|
|
# Ensure sudo privileges are available
|
|
check_sudo
|
|
|
|
# Populate Developer Keys (with error handling)
|
|
log_message "Populating Developer Keys..."
|
|
if ! sudo pacman-key --init; then
|
|
log_error "Failed to initialize pacman keys."
|
|
exit 1
|
|
fi
|
|
|
|
if ! sudo pacman-key --populate snigdhaos archlinux chaotic; then
|
|
log_error "Failed to populate pacman keys."
|
|
exit 1
|
|
fi
|
|
|
|
# Copy Snigdha OS Grub Theme if not already done
|
|
log_message "Checking if Snigdha OS Grub Theme is already copied..."
|
|
if [ ! -f /tmp/systemd-boot ]; then
|
|
log_message "Copying Snigdha OS Grub Theme..."
|
|
sudo mkdir -p /boot/grub/themes
|
|
if ! sudo cp -Rf /usr/share/grub/themes/snigdhaos-grub-theme /boot/grub/themes/; then
|
|
log_error "Failed to copy Snigdha OS Grub Theme."
|
|
exit 1
|
|
fi
|
|
else
|
|
log_message "Snigdha OS Grub Theme already copied. Skipping."
|
|
fi
|
|
|
|
# Set Snigdha OS Arctic Preset
|
|
log_message "Setting Snigdha OS Arctic Preset..."
|
|
if ! sudo mv -v /etc/mkinitcpio.d/snigdhaos /etc/mkinitcpio.d/linux.preset; then
|
|
log_error "Failed to set Snigdha OS Arctic Preset."
|
|
exit 1
|
|
fi
|
|
|
|
log_message "End Execution!"
|