mirror of
https://github.com/leitbogioro/Tools.git
synced 2025-12-27 12:58:25 +08:00
Update InstallNET.sh
This commit is contained in:
parent
9f26379047
commit
303fc7a672
1 changed files with 9 additions and 5 deletions
|
|
@ -1348,7 +1348,10 @@ function checkSys() {
|
|||
sed -i 's/^\(deb.*security.debian.org\/\)\(.*\)\/updates/\1debian-security\2-security/g' /etc/apt/sources.list
|
||||
|
||||
CurrentOSVer=$(cat /etc/os-release | grep -w "VERSION_ID=*" | awk -F '=' '{print $2}' | sed 's/\"//g' | cut -d'.' -f 1)
|
||||
|
||||
DebianRelease=""
|
||||
IsUbuntu=$(uname -a | grep -i "ubuntu")
|
||||
IsDebian=$(uname -a | grep -i "debian")
|
||||
IsKali=$(uname -a | grep -i "kali")
|
||||
apt update -y
|
||||
# Try to fix error of connecting to current mirror for Debian.
|
||||
if [[ $? -ne 0 ]]; then
|
||||
|
|
@ -1366,6 +1369,11 @@ function checkSys() {
|
|||
sed -ri 's/^deb-src/# deb-src/g' /etc/apt/sources.list
|
||||
apt update -y
|
||||
fi
|
||||
# fix security signature check failure of Kali.
|
||||
if [[ "$IsKali" ]] && [[ $(grep -i "public key is not available" /root/apt_execute.log) || $(grep -i "an error occurred during the signature verification" /root/apt_execute.log) || $(grep -i "the following signatures couldn't be verified" /root/apt_execute.log) ]]; then
|
||||
wget https://archive.kali.org/archive-keyring.gpg -O /usr/share/keyrings/kali-archive-keyring.gpg
|
||||
apt update -y
|
||||
fi
|
||||
rm -rf /root/apt_execute.log
|
||||
fi
|
||||
apt install lsb-release -y
|
||||
|
|
@ -1383,10 +1391,6 @@ function checkSys() {
|
|||
[[ -n "$Count" ]] && RedHatRelease=$(echo -e "$Count")"$RedHatRelease"
|
||||
done
|
||||
|
||||
DebianRelease=""
|
||||
IsUbuntu=$(uname -a | grep -i "ubuntu")
|
||||
IsDebian=$(uname -a | grep -i "debian")
|
||||
IsKali=$(uname -a | grep -i "kali")
|
||||
for Count in $(cat /etc/os-release | grep -w "ID=*" | awk -F '=' '{print $2}') $(cat /etc/issue | awk '{print $1}') "$OsLsb"; do
|
||||
[[ -n "$Count" ]] && DebianRelease=$(echo -e "$Count")"$DebianRelease"
|
||||
done
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue