Skip to content

Commit 65f4885

Browse files
authored
refactor: replace wget with curl (#1343)
- Replace `wget` with `curl` for downloading Easy-RSA - Remove `wget` from package dependencies across all distributions - Ensure `curl` and `ca-certificates` are installed on all distributions - Add `--retry 3` for automatic retries on transient network failures
1 parent 599d122 commit 65f4885

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

openvpn-install.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -952,17 +952,17 @@ function installOpenVPN() {
952952
953953
log_info "Installing OpenVPN and dependencies..."
954954
if [[ $OS =~ (debian|ubuntu) ]]; then
955-
run_cmd "Installing OpenVPN" apt-get install -y openvpn iptables openssl wget
955+
run_cmd "Installing OpenVPN" apt-get install -y openvpn iptables openssl curl ca-certificates
956956
elif [[ $OS == 'centos' ]]; then
957-
run_cmd "Installing OpenVPN" yum install -y openvpn iptables openssl wget ca-certificates curl tar 'policycoreutils-python*'
957+
run_cmd "Installing OpenVPN" yum install -y openvpn iptables openssl ca-certificates curl tar 'policycoreutils-python*'
958958
elif [[ $OS == 'oracle' ]]; then
959-
run_cmd "Installing OpenVPN" yum install -y openvpn iptables openssl wget ca-certificates curl tar policycoreutils-python-utils
959+
run_cmd "Installing OpenVPN" yum install -y openvpn iptables openssl ca-certificates curl tar policycoreutils-python-utils
960960
elif [[ $OS == 'amzn2023' ]]; then
961-
run_cmd "Installing OpenVPN" dnf install -y openvpn iptables openssl wget ca-certificates
961+
run_cmd "Installing OpenVPN" dnf install -y openvpn iptables openssl ca-certificates curl
962962
elif [[ $OS == 'fedora' ]]; then
963-
run_cmd "Installing OpenVPN" dnf install -y openvpn iptables openssl wget ca-certificates curl policycoreutils-python-utils
963+
run_cmd "Installing OpenVPN" dnf install -y openvpn iptables openssl ca-certificates curl policycoreutils-python-utils
964964
elif [[ $OS == 'arch' ]]; then
965-
run_cmd "Installing OpenVPN" pacman --needed --noconfirm -Syu openvpn iptables openssl wget ca-certificates curl
965+
run_cmd "Installing OpenVPN" pacman --needed --noconfirm -Syu openvpn iptables openssl ca-certificates curl
966966
fi
967967
968968
# Verify ChaCha20-Poly1305 compatibility if selected
@@ -1002,7 +1002,7 @@ function installOpenVPN() {
10021002
10031003
# Install the latest version of easy-rsa from source, if not already installed.
10041004
if [[ ! -d /etc/openvpn/easy-rsa/ ]]; then
1005-
run_cmd "Downloading Easy-RSA v${EASYRSA_VERSION}" wget -O ~/easy-rsa.tgz "https://github.com/OpenVPN/easy-rsa/releases/download/v${EASYRSA_VERSION}/EasyRSA-${EASYRSA_VERSION}.tgz"
1005+
run_cmd "Downloading Easy-RSA v${EASYRSA_VERSION}" curl -fL --retry 3 -o ~/easy-rsa.tgz "https://github.com/OpenVPN/easy-rsa/releases/download/v${EASYRSA_VERSION}/EasyRSA-${EASYRSA_VERSION}.tgz"
10061006
log_info "Verifying Easy-RSA checksum..."
10071007
CHECKSUM_OUTPUT=$(echo "${EASYRSA_SHA256} $HOME/easy-rsa.tgz" | sha256sum -c 2>&1) || {
10081008
_log_to_file "[CHECKSUM] $CHECKSUM_OUTPUT"

0 commit comments

Comments
 (0)