openvpn: simplify killbypid()

This commit is contained in:
Franco Fichtner 2023-03-14 10:28:42 +01:00
parent 9be3015c75
commit 4a2fb77576

View File

@ -904,7 +904,7 @@ function openvpn_restart($mode, $settings, $carp_event = false)
return;
}
killbypid("/var/run/openvpn_{$mode_id}.pid", 'TERM', true);
killbypid("/var/run/openvpn_{$mode_id}.pid");
if (isset($settings['disable'])) {
return;
@ -950,7 +950,7 @@ function openvpn_delete($mode, &$settings)
$devname = "ovpnc{$vpnid}";
}
killbypid("/var/run/openvpn_{$mode_id}.pid", 'TERM', true);
killbypid("/var/run/openvpn_{$mode_id}.pid");
mwexecf('/sbin/ifconfig %s destroy', array($devname));