From 4b7a4ad870d8363ff5c614d634ab917b479a931b Mon Sep 17 00:00:00 2001 From: "[ ]" <[ ]> Date: Thu, 23 Jun 2022 05:11:05 +0900 Subject: [PATCH 1/2] [fix] : run openvpn as root to create TUN device --- nm-vpngate | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nm-vpngate b/nm-vpngate index cff2e94..17560e1 100755 --- a/nm-vpngate +++ b/nm-vpngate @@ -677,7 +677,7 @@ _connect_vpn_nm(){ _connect_vpn_openvpn(){ local _ovpn_file="$CONFIG_DIR/$PROFILE_NAME.ovpn" test -e "$_ovpn_file" || { _error "$PROFILE_NAME was not found."; return 1; } - _run openvpn --config "$_ovpn_file" + _run sudo openvpn --config "$_ovpn_file" } _connect_vpn(){ From 71cdb2fee1b71c0124ecd589db9f991b2b8b92b7 Mon Sep 17 00:00:00 2001 From: "[ ]" <[ ]> Date: Sun, 10 Jul 2022 05:55:07 +0900 Subject: [PATCH 2/2] [update] : Account for graphical modes when running openvpn --- nm-vpngate | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nm-vpngate b/nm-vpngate index 17560e1..6e4f8f4 100755 --- a/nm-vpngate +++ b/nm-vpngate @@ -677,7 +677,11 @@ _connect_vpn_nm(){ _connect_vpn_openvpn(){ local _ovpn_file="$CONFIG_DIR/$PROFILE_NAME.ovpn" test -e "$_ovpn_file" || { _error "$PROFILE_NAME was not found."; return 1; } - _run sudo openvpn --config "$_ovpn_file" + if [[ "${MODE}" = "GUI-"* ]]; then + _run pkexec openvpn --config "$_ovpn_file" + else + _run sudo openvpn --config "$_ovpn_file" + fi } _connect_vpn(){