Revision 48e24ada
Added by Jim Pingle over 13 years ago
etc/inc/upgrade_config.inc | ||
---|---|---|
1626 | 1626 |
if (!empty($server['custom_options'])) { |
1627 | 1627 |
$cstmopts = array(); |
1628 | 1628 |
$tmpcstmopts = explode(";", $server['custom_options']); |
1629 |
$assigned = false;
|
|
1629 |
$assigned_if = "";
|
|
1630 | 1630 |
$tmpstr = ""; |
1631 | 1631 |
foreach ($tmpcstmopts as $tmpcstmopt) { |
1632 | 1632 |
$tmpstr = str_replace(" ", "", $tmpcstmopt); |
1633 | 1633 |
if (substr($tmpstr,0 ,6) == "devtun") { |
1634 |
$assigned = true;
|
|
1634 |
$assigned_if = substr($tmpstr, 3);
|
|
1635 | 1635 |
continue; |
1636 | 1636 |
} else if (substr($tmpstr, 0, 5) == "local") { |
1637 | 1637 |
$localip = substr($tmpstr, 5); |
... | ... | |
1640 | 1640 |
$cstmopts[] = $tmpcstmopt; |
1641 | 1641 |
} |
1642 | 1642 |
$server['custom_options'] = implode(";", $cstmopts); |
1643 |
if ($assigned == true) { |
|
1644 |
$realif = substr($tmpstr, 3); |
|
1643 |
if (!empty($assigned_if)) { |
|
1645 | 1644 |
foreach ($config['interfaces'] as $iface => $cfgif) { |
1646 |
if ($cfgif['if'] == $realif) {
|
|
1645 |
if ($cfgif['if'] == $assigned_if) {
|
|
1647 | 1646 |
$config['interfaces'][$iface]['if'] = "ovpns{$server['vpnid']}"; |
1648 | 1647 |
break; |
1649 | 1648 |
} |
... | ... | |
1728 | 1727 |
if (!empty($client['custom_options'])) { |
1729 | 1728 |
$cstmopts = array(); |
1730 | 1729 |
$tmpcstmopts = explode(";", $client['custom_options']); |
1731 |
$assigned = false;
|
|
1730 |
$assigned_if = "";
|
|
1732 | 1731 |
$tmpstr = ""; |
1733 | 1732 |
foreach ($tmpcstmopts as $tmpcstmopt) { |
1734 | 1733 |
$tmpstr = str_replace(" ", "", $tmpcstmopt); |
1735 | 1734 |
if (substr($tmpstr,0 ,6) == "devtun") { |
1736 |
$assigned = true;
|
|
1735 |
$assigned_if = substr($tmpstr, 3);
|
|
1737 | 1736 |
continue; |
1738 | 1737 |
} else if (substr($tmpstr, 0, 5) == "local") { |
1739 | 1738 |
$localip = substr($tmpstr, 5); |
... | ... | |
1742 | 1741 |
$cstmopts[] = $tmpcstmopt; |
1743 | 1742 |
} |
1744 | 1743 |
$client['custom_options'] = implode(";", $cstmopts); |
1745 |
if ($assigned == true) { |
|
1746 |
$realif = substr($tmpstr, 3); |
|
1744 |
if (!empty($assigned_if)) { |
|
1747 | 1745 |
foreach ($config['interfaces'] as $iface => $cfgif) { |
1748 |
if ($cfgif['if'] == $realif) {
|
|
1746 |
if ($cfgif['if'] == $assigned_if) {
|
|
1749 | 1747 |
$config['interfaces'][$iface]['if'] = "ovpnc{$client['vpnid']}"; |
1750 | 1748 |
break; |
1751 | 1749 |
} |
Also available in: Unified diff
Fix upgrade code for 1.2.3 with assigned OpenVPN interface.