You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
951 B
53 lines
951 B
#!/bin/sh
|
|
|
|
set -uo pipefail
|
|
|
|
if (( $EUID != 0 )); then
|
|
echo "Should be run as root"
|
|
exit 1
|
|
fi
|
|
|
|
# Setup pacman
|
|
read -p ":: Run setup_pacman? [y/N] " setuppacman
|
|
setuppacman=${setuppacman:-N}
|
|
|
|
if [[ $setuppacman =~ [yY] ]]; then
|
|
source "./setup_pacman"
|
|
fi
|
|
|
|
echo ":: Checking if dialog is installed"
|
|
pacman -Q dialog &> /dev/null
|
|
if [ $? = 1 ]; then
|
|
echo ":: Installing dialog"
|
|
pacman -Syu dialog
|
|
else
|
|
echo ":: Success: dialog is installed"
|
|
fi
|
|
|
|
DEFAULT_STATE="on"
|
|
|
|
files=""
|
|
for file in $(ls packages); do
|
|
files="${files}${file} ${file} ${DEFAULT_STATE} "
|
|
done
|
|
|
|
answers=$(dialog --no-tags --stdout --checklist "select group of packages to install" 0 0 15 $files)
|
|
|
|
if [ $? = 1 ]; then
|
|
printf "\n\nAborting...\n"
|
|
exit 1
|
|
fi
|
|
|
|
printf "\n\nSelected groups: $answers\n\n"
|
|
|
|
packages=""
|
|
|
|
for answer in $answers; do
|
|
p=$(cat ./packages/$answer)
|
|
packages="${packages}${p} "
|
|
done
|
|
|
|
printf "packages: $packages\n\n"
|
|
|
|
sudo pacman -Syu $packages
|