From 63eff762ddd8b7029b0e12f2975ecc380fdfcc0b Mon Sep 17 00:00:00 2001 From: Stanislas Date: Mon, 15 Dec 2025 12:36:18 +0100 Subject: [PATCH] fix: use run_cmd_fatal for package list updates (#1423) ## Summary - Changed `apt-get update` commands from `run_cmd` to `run_cmd_fatal` - Package list updates are critical operations that should fail the installation if they fail - Affects 3 locations: initial update, post-repo-add update, and removal cleanup --- openvpn-install.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/openvpn-install.sh b/openvpn-install.sh index b6143f1..f6161c0 100755 --- a/openvpn-install.sh +++ b/openvpn-install.sh @@ -1473,7 +1473,7 @@ function installOpenVPNRepo() { log_info "Setting up official OpenVPN repository..." if [[ $OS =~ (debian|ubuntu) ]]; then - run_cmd "Update package lists" apt-get update + run_cmd_fatal "Update package lists" apt-get update run_cmd_fatal "Installing prerequisites" apt-get install -y ca-certificates curl # Create keyrings directory @@ -1491,7 +1491,7 @@ function installOpenVPNRepo() { echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/openvpn-repo-public.asc] https://build.openvpn.net/debian/openvpn/stable ${VERSION_CODENAME} main" >/etc/apt/sources.list.d/openvpn-aptrepo.list log_info "Updating package lists with new repository..." - run_cmd "Update package lists" apt-get update + run_cmd_fatal "Update package lists" apt-get update log_info "OpenVPN official repository configured" @@ -3472,7 +3472,7 @@ function removeOpenVPN() { if [[ -e /etc/apt/keyrings/openvpn-repo-public.asc ]]; then run_cmd "Removing OpenVPN GPG key" rm /etc/apt/keyrings/openvpn-repo-public.asc fi - run_cmd "Updating package lists" apt-get update + run_cmd_fatal "Updating package lists" apt-get update elif [[ $OS == 'arch' ]]; then run_cmd "Removing OpenVPN" pacman --noconfirm -R openvpn elif [[ $OS =~ (centos|oracle) ]]; then