update update_repo function

This commit is contained in:
m0duspwnens
2022-04-05 15:40:39 -04:00
parent b467cde9ad
commit 1248ba8924
4 changed files with 18 additions and 8 deletions

View File

@@ -935,8 +935,19 @@ update_repo() {
yum repolist
fi
elif [[ "$OS" == "ubuntu" ]]; then
cp $UPDATE_DIR/salt/repo/client/files/ubuntu/$ubuntu_version/* /etc/apt/sources.list.d/
apt-get update
ubuntu_version=$(grep VERSION_ID /etc/os-release | awk -F '[ "]' '{print $2}')
if grep -q "UBUNTU_CODENAME=bionic" /etc/os-release; then
OSVER=bionic
elif grep -q "UBUNTU_CODENAME=focal" /etc/os-release; then
OSVER=focal
else
echo "We do not support your current version of Ubuntu."
exit 1
fi
echo "deb http://repo.saltstack.com/py3/ubuntu/$ubuntu_version/amd64/archive/3004.1 $OSVER main" > /etc/apt/sources.list.d/saltstack.list
apt-get update
fi
}