linutil/tabs/system-setup/fedora/configure-dnf.sh

24 lines
835 B
Bash
Raw Normal View History

#!/bin/sh -e
. ../../common-script.sh
configureDNF() {
2024-09-19 19:05:36 +01:00
case "$PACKAGER" in
dnf)
printf "%b\n" "${YELLOW}Configuring DNF...${RC}"
2024-09-19 19:05:36 +01:00
"$ESCALATION_TOOL" sed -i '/^max_parallel_downloads=/c\max_parallel_downloads=10' /etc/dnf/dnf.conf || echo 'max_parallel_downloads=10' >> /etc/dnf/dnf.conf
echo "fastestmirror=True" | "$ESCALATION_TOOL" tee -a /etc/dnf/dnf.conf > /dev/null
echo "defaultyes=True" | "$ESCALATION_TOOL" tee -a /etc/dnf/dnf.conf > /dev/null
"$ESCALATION_TOOL" "$PACKAGER" -y install dnf-plugins-core
printf "%b\n" "${GREEN}DNF Configured Succesfully...${RC}"
;;
*)
printf "%b\n" "${RED}Unsupported distribution: $DTYPE${RC}"
;;
esac
}
checkEnv
checkEscalationTool
configureDNF