mirror of
https://github.com/angristan/openvpn-install.git
synced 2025-12-16 17:07:02 +01:00
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
This commit is contained in:
@@ -1473,7 +1473,7 @@ function installOpenVPNRepo() {
|
|||||||
log_info "Setting up official OpenVPN repository..."
|
log_info "Setting up official OpenVPN repository..."
|
||||||
|
|
||||||
if [[ $OS =~ (debian|ubuntu) ]]; then
|
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
|
run_cmd_fatal "Installing prerequisites" apt-get install -y ca-certificates curl
|
||||||
|
|
||||||
# Create keyrings directory
|
# 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
|
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..."
|
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"
|
log_info "OpenVPN official repository configured"
|
||||||
|
|
||||||
@@ -3472,7 +3472,7 @@ function removeOpenVPN() {
|
|||||||
if [[ -e /etc/apt/keyrings/openvpn-repo-public.asc ]]; then
|
if [[ -e /etc/apt/keyrings/openvpn-repo-public.asc ]]; then
|
||||||
run_cmd "Removing OpenVPN GPG key" rm /etc/apt/keyrings/openvpn-repo-public.asc
|
run_cmd "Removing OpenVPN GPG key" rm /etc/apt/keyrings/openvpn-repo-public.asc
|
||||||
fi
|
fi
|
||||||
run_cmd "Updating package lists" apt-get update
|
run_cmd_fatal "Updating package lists" apt-get update
|
||||||
elif [[ $OS == 'arch' ]]; then
|
elif [[ $OS == 'arch' ]]; then
|
||||||
run_cmd "Removing OpenVPN" pacman --noconfirm -R openvpn
|
run_cmd "Removing OpenVPN" pacman --noconfirm -R openvpn
|
||||||
elif [[ $OS =~ (centos|oracle) ]]; then
|
elif [[ $OS =~ (centos|oracle) ]]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user