Run apt update & apt upgrade

This commit is contained in:
Alex
2023-06-01 17:58:08 -06:00
parent d56cfe7f30
commit b7589882db

10
ishare2
View File

@@ -158,12 +158,22 @@ function install_aria2c() {
# check if aria2c is installed otherwise install it
if ! command -v aria2c &>/dev/null; then
echo -e "${YELLOW} [+] aria2c is not installed.${NO_COLOR}"
echo -e "${YELLOW} [+] Updating package lists...${NO_COLOR}"
if ! apt-get update; then
echo -e "${RED} [-] Failed to update package lists.${NO_COLOR}"
exit 1
fi
echo -e "${YELLOW} [+] Installing aria2c...${NO_COLOR}"
if ! apt-get install -y aria2; then
echo -e "${RED} [-] Failed to install aria2c.${NO_COLOR}"
exit 1
fi
echo -e "${YELLOW} [+] Installing unrar...${NO_COLOR}"
if ! apt-get install -y unrar; then
echo -e "${RED} [-] Failed to install unrar.${NO_COLOR}"
exit 1
fi
echo -e "${GREEN} [+] Done.${NO_COLOR}"
else
echo -e "${GREEN} [+] aria2c already is installed.${NO_COLOR}" >>$ISHARE2_DIR/logs.txt