summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--etc/inc/openvpn.inc11
-rw-r--r--usr/local/pkg/openvpn.xml3
2 files changed, 13 insertions, 1 deletions
diff --git a/etc/inc/openvpn.inc b/etc/inc/openvpn.inc
index c076656..447a7c0 100644
--- a/etc/inc/openvpn.inc
+++ b/etc/inc/openvpn.inc
@@ -45,6 +45,14 @@ require_once('config.inc');
require_once('pfsense-utils.inc');
require_once('util.inc');
+// Shutdown running process if needed
+function openvpn_delete($id) {
+ global $g, $config;
+ $ps = $g['varetc_path'] . "/openvpn_{$mode}{$id}.conf";
+ $ps_id = `ps awux | grep $ps | awk '{ print $2 }'`;
+ killbypid($ps_id);
+}
+
// Return the list of ciphers OpenVPN supports
function openvpn_get_ciphers($pkg) {
global $config;
@@ -811,4 +819,5 @@ function openvpn_print_javascript2() {
EOD;
print($javascript);
}
-?>
+
+?> \ No newline at end of file
diff --git a/usr/local/pkg/openvpn.xml b/usr/local/pkg/openvpn.xml
index 89ea35f..3e77cdb 100644
--- a/usr/local/pkg/openvpn.xml
+++ b/usr/local/pkg/openvpn.xml
@@ -284,6 +284,9 @@
<type>input</type>
</field>
</fields>
+ <custom_delete_php_command>
+ openvpn_delete($id);
+ </custom_delete_php_command>
<custom_php_command_before_form>
openvpn_get_ciphers(&amp;$pkg);
</custom_php_command_before_form>
OpenPOWER on IntegriCloud