From c7acd3294603dab111e7618da17160cbde8bb851 Mon Sep 17 00:00:00 2001 From: Stanislas Lange Date: Sun, 7 Dec 2025 23:18:44 +0100 Subject: [PATCH] Fix missing /etc/sysctl.d directory on some systems Create the directory before writing to it to avoid errors on systems like CentOS Stream 9 containers where it may not exist. --- openvpn-install.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/openvpn-install.sh b/openvpn-install.sh index d299d3c..fd97482 100755 --- a/openvpn-install.sh +++ b/openvpn-install.sh @@ -1113,6 +1113,7 @@ verb 3" >>/etc/openvpn/server.conf # Enable routing log_info "Enabling IP forwarding..." + mkdir -p /etc/sysctl.d echo 'net.ipv4.ip_forward=1' >/etc/sysctl.d/99-openvpn.conf if [[ $IPV6_SUPPORT == 'y' ]]; then echo 'net.ipv6.conf.all.forwarding=1' >>/etc/sysctl.d/99-openvpn.conf