Files
shell/install/grub-customizer
T
2026-07-10 15:11:51 +08:00

50 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
##makedesc: Install grub-customizer (latest + ppa)
set -eo pipefail
if [ "$(uname -s)" = "Darwin" ]; then
echo "ERROR: grub-customizer is not supported on macOS." >&2
exit 1
fi
install() {
echo
echo "==============================================="
echo "Installing grub-customizer"
echo "==============================================="
echo
sudo add-apt-repository -y ppa:danielrichter2007/grub-customizer
sudo apt install -y --autoremove grub-customizer
echo
echo "Finish!"
grub-customizer -v
echo
}
remove() {
echo
echo "==============================================="
echo "Removing grub-customizer"
echo "==============================================="
echo
source_file="/etc/apt/sources.list.d/$(ls -1 /etc/apt/sources.list.d/ | grep danielrichter2007)"
sudo apt remove -y --autoremove grub-customizer
if [ -f "$source_file" ]; then
sudo rm "$source_file"
sudo apt update
fi
echo
echo "Finish!"
echo
}
case "$1" in
r|remove|d|delete|p|purge) remove ;;
*) install ;;
esac