Commit 8b98a850 authored by Franco Fichtner's avatar Franco Fichtner

openvpn: *_by_id() sounds a little more idiomatic

(cherry picked from commit b6cfa710)
parent a43db06c
......@@ -807,7 +807,7 @@ function openvpn_reconfigure($mode, $settings)
@chmod("/var/etc/openvpn/{$mode_id}.conf", 0600);
}
function openvpn_restart_by_vpnid($mode, $vpnid)
function openvpn_restart_by_id($mode, $id)
{
global $config;
......@@ -818,7 +818,7 @@ function openvpn_restart_by_vpnid($mode, $vpnid)
if (isset($settings['disable'])) {
continue;
}
if ($vpnid != 0 && $vpnid == $settings['vpnid']) {
if ($id != 0 && $id == $settings['vpnid']) {
$found = $settings;
break;
}
......
......@@ -2662,8 +2662,8 @@ function services_get()
$pconfig['id'] = $id;
$pconfig['vpnid'] = $setting['vpnid'];
$pconfig['description'] = gettext("OpenVPN") . " ".$mode.": ".htmlspecialchars($setting['description']);
$pconfig['php']['restart'] = array('openvpn_restart_by_vpnid');
$pconfig['php']['start'] = array('openvpn_restart_by_vpnid');
$pconfig['php']['restart'] = array('openvpn_restart_by_id');
$pconfig['php']['start'] = array('openvpn_restart_by_id');
$pconfig['php']['args'] = array('mode', 'vpnid');
$pconfig['pidfile'] = "/var/run/openvpn_{$mode}{$setting['vpnid']}.pid";
$services[] = $pconfig;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment