Files
HamPack/install.sh
2026-03-19 15:30:18 -06:00

105 lines
2.9 KiB
Bash
Executable File

#!/bin/bash -i
#
# Purpose : HamPack installer
# Print the logo
print_logo() {
cat << "EOF"
██╗ ██╗ █████╗ ███╗ ███╗██████╗ █████╗ ██████╗██╗ ██╗
██║ ██║██╔══██╗████╗ ████║██╔══██╗██╔══██╗██╔════╝██║ ██╔╝
███████║███████║██╔████╔██║██████╔╝███████║██║ █████╔╝
██╔══██║██╔══██║██║╚██╔╝██║██╔═══╝ ██╔══██║██║ ██╔═██╗
██║ ██║██║ ██║██║ ╚═╝ ██║██║ ██║ ██║╚██████╗██║ ██╗
╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝
EOF
}
# --- Main ---
set -e
clear
print_logo
cd ~
sudo -v
echo "Getting the latest version of HamPack..."
rm -rf ~/.local/share/HamPack
git clone https://gitea.young.computer/david/HamPack.git ~/.local/share/HamPack > /dev/null
sudo cp ~/.local/share/HamPack/hampackrefresh ~/.local/bin/hampackrefresh
sudo cp ~/.local/share/HamPack/hampackupdate ~/.local/bin/hampackupdate
cd ~/.local/share/HamPack
# Source utility functions
source utils.sh
# Source package list
if [ ! -f "packages.conf" ]; then
echo "Error: packages.conf not found!"
exit 1
fi
source packages.conf
echo "Updating system..."
sudo pacman -Syu --noconfirm
cd ~/
# Install yay AUR helper if not present
if ! command -v yay &> /dev/null; then
echo "Installing yay AUR helper..."
sudo pacman -S --needed git base-devel --noconfirm
if [[ -d "yay" ]]; then
echo "yay directory already exists, removing it..."
rm -rf yay
fi
echo "Cloning yay repository..."
git clone https://aur.archlinux.org/yay.git
cd yay
echo "Building yay..."
makepkg -si --noconfirm
cd ..
rm -rf yay
else
echo "yay is already installed."
fi
echo "Installing system utilities..."
install_packages "${UTILITIES[@]}"
echo "Installing applications..."
install_packages "${APPLICATIONS[@]}"
cd ~/.local/share/HamPack
echo "Installing Flatpak applications..."
. install-flatpaks.sh
echo "Installing stand-alone compiled applications..."
. install-compiled.sh
if ! ls /usr/lib/modules/$(uname -r) > /dev/null 2>&1; then
echo "HamPack is installed. A newer kernel has been installed, a reboot is recommended."
read -rp "Reboot now? [y/N] " response
case "$response" in
[yY][eE][sS]|[yY])
echo "Rebooting..."
sudo reboot
;;
*)
echo "Reboot skipped. Please remember to reboot when convenient."
exit 0
;;
esac
else
echo "Ham Pack is installed. Reboot when convenient."
fi