nexxx schriebecho "Checking for working internet connection"
if $(ping -c1 google.com &>/dev/null); then
echo Internet is up
else
echo Internet is down
fi
echo "Recommended groups are:"
“video”, “audio”, “optical” and of course “users” (default group). All other groups are rather useless or dangerous.
ARCHI=`lscpu | awk '{print $2}' | head -n1`
But what if the user installed x86 even if he has a 64 bits CPU? Better use “uname -m”
echo "Install BLA?"
/me likes functional programming 🙂
function installpackage () {
echo "Install ${1}?"
echo "y) yes"
echo "n) no"
echo -n "Selection > "
read ANSWERE
echo ""
echo ""
case "$ANSWERE" in
"y")
pacman -S ${2}
echo "${1} installed"
;;
*)
echo "${1} NOT installed"
;;
esac
echo "--------------------------------------------------------------------------------"
echo "Continue with RETURN"
read
clear
}
And now you can simply use this …
installpackage "Super awesome description" package-name
installpackage ALSA alsa-utils
installpackage X-Server "xorg-server xorg-xinit xorg-utils xorg-server-utils"
… for all packages that do not need special selections.
yaourt -S tlp
What if the user decided not to install yaourt in the previous step?