1
0
mirror of synced 2024-11-21 20:46:10 +03:00

Improve VPN setup

- Retry certain 'apt-get' and 'yum' commands on failure
This commit is contained in:
hwdsl2 2022-02-08 23:24:46 -06:00
parent d01cc0b97a
commit 86d4f2f93c
7 changed files with 17 additions and 13 deletions

View File

@ -686,7 +686,7 @@ install_base64_uuidgen() {
bigecho2 "Installing required packages..."
if [ "$os_type" = "ubuntu" ] || [ "$os_type" = "debian" ] || [ "$os_type" = "raspbian" ]; then
export DEBIAN_FRONTEND=noninteractive
apt-get -yqq update || exiterr "'apt-get update' failed."
apt-get -yqq update || apt-get -yqq update || exiterr "'apt-get update' failed."
fi
fi
if ! command -v base64 >/dev/null 2>&1; then
@ -1018,7 +1018,7 @@ apply_ubuntu1804_nss_fix() {
if wget -t 3 -T 30 -q -O "$tmpdir/1.deb" "$nss_url1/$nss_deb1" \
&& wget -t 3 -T 30 -q -O "$tmpdir/2.deb" "$nss_url1/$nss_deb2" \
&& wget -t 3 -T 30 -q -O "$tmpdir/3.deb" "$nss_url2/$nss_deb3"; then
apt-get -yqq update
apt-get -yqq update || apt-get -yqq update
apt-get -yqq install "$tmpdir/1.deb" "$tmpdir/2.deb" "$tmpdir/3.deb" >/dev/null
fi
/bin/rm -f "$tmpdir/1.deb" "$tmpdir/2.deb" "$tmpdir/3.deb"

View File

@ -153,16 +153,16 @@ install_pkgs() {
export DEBIAN_FRONTEND=noninteractive
(
set -x
apt-get -yqq update
apt-get -yqq update || apt-get -yqq update
) || exiterr "'apt-get update' failed."
(
set -x
apt-get -yqq install wget >/dev/null
apt-get -yqq install wget >/dev/null || apt-get -yqq install wget >/dev/null
) || exiterr "'apt-get install wget' failed."
elif [ "$os_type" != "alpine" ]; then
(
set -x
yum -y -q install wget >/dev/null
yum -y -q install wget >/dev/null || yum -y -q install wget >/dev/null
) || exiterr "'yum install wget' failed."
fi
fi

View File

@ -108,16 +108,16 @@ install_pkgs() {
export DEBIAN_FRONTEND=noninteractive
(
set -x
apt-get -yqq update
apt-get -yqq update || apt-get -yqq update
) || exiterr "'apt-get update' failed."
(
set -x
apt-get -yqq install wget >/dev/null
apt-get -yqq install wget >/dev/null || apt-get -yqq install wget >/dev/null
) || exiterr "'apt-get install wget' failed."
elif [ "$os_type" != "alpine" ]; then
(
set -x
yum -y -q install wget >/dev/null
yum -y -q install wget >/dev/null || yum -y -q install wget >/dev/null
) || exiterr "'yum install wget' failed."
fi
fi

View File

@ -157,7 +157,7 @@ update_apt_cache() {
export DEBIAN_FRONTEND=noninteractive
(
set -x
apt-get -yqq update
apt-get -yqq update || apt-get -yqq update
) || exiterr "'apt-get update' failed."
}

View File

@ -206,16 +206,16 @@ install_pkgs() {
export DEBIAN_FRONTEND=noninteractive
(
set -x
apt-get -yqq update
apt-get -yqq update || apt-get -yqq update
) || exiterr "'apt-get update' failed."
(
set -x
apt-get -yqq install wget >/dev/null
apt-get -yqq install wget >/dev/null || apt-get -yqq install wget >/dev/null
) || exiterr "'apt-get install wget' failed."
elif [ "$os_type" != "alpine" ]; then
(
set -x
yum -y -q install wget >/dev/null
yum -y -q install wget >/dev/null || yum -y -q install wget >/dev/null
) || exiterr "'yum install wget' failed."
fi
fi

View File

@ -143,6 +143,8 @@ install_setup_pkgs() {
(
set -x
yum -y -q install wget bind-utils openssl tar \
iptables iproute gawk grep sed net-tools >/dev/null \
|| yum -y -q install wget bind-utils openssl tar \
iptables iproute gawk grep sed net-tools >/dev/null
) || exiterr2
}

View File

@ -169,7 +169,7 @@ update_apt_cache() {
export DEBIAN_FRONTEND=noninteractive
(
set -x
apt-get -yqq update
apt-get -yqq update || apt-get -yqq update
) || exiterr "'apt-get update' failed."
}
@ -177,6 +177,8 @@ install_setup_pkgs() {
(
set -x
apt-get -yqq install wget dnsutils openssl \
iptables iproute2 gawk grep sed net-tools >/dev/null \
|| apt-get -yqq install wget dnsutils openssl \
iptables iproute2 gawk grep sed net-tools >/dev/null
) || exiterr2
}