Revision f03f4cc3
Added by Renato Botelho almost 5 years ago
src/etc/inc/interfaces.inc | ||
---|---|---|
1710 | 1710 |
} |
1711 | 1711 |
// Create IPsec interface |
1712 | 1712 |
if (does_interface_exist($ipsecif)) { |
1713 |
mwexec("/sbin/ifconfig " . escapeshellarg($ipsecif) . " destroy", false);
|
|
1713 |
mwexec("/sbin/ifconfig " . escapeshellarg($ipsecif) . " destroy"); |
|
1714 | 1714 |
} |
1715 |
mwexec("/sbin/ifconfig " . escapeshellarg($ipsecif) . " create reqid " . escapeshellarg($ipsecifnum), false);
|
|
1715 |
mwexec("/sbin/ifconfig " . escapeshellarg($ipsecif) . " create reqid " . escapeshellarg($ipsecifnum)); |
|
1716 | 1716 |
|
1717 | 1717 |
/* Apply the outer tunnel addresses to the interface */ |
1718 | 1718 |
$inet = is_ipaddrv6($left_spec) ? "inet6" : "inet"; |
1719 |
mwexec("/sbin/ifconfig " . escapeshellarg($ipsecif) . " {$inet} tunnel " . escapeshellarg($left_spec) . " " . escapeshellarg($right_spec) . " up", false);
|
|
1719 |
mwexec("/sbin/ifconfig " . escapeshellarg($ipsecif) . " {$inet} tunnel " . escapeshellarg($left_spec) . " " . escapeshellarg($right_spec) . " up"); |
|
1720 | 1720 |
|
1721 | 1721 |
/* Loop through all of the addresses for this interface and apply them as needed */ |
1722 | 1722 |
foreach ($addrs as $addr) { |
... | ... | |
1731 | 1731 |
$right = escapeshellarg($addr['right']); |
1732 | 1732 |
} |
1733 | 1733 |
|
1734 |
mwexec("/sbin/ifconfig " . escapeshellarg($ipsecif) . " {$inet} " . escapeshellarg($addr['left']) . " " . $right . $addr['alias'], false);
|
|
1734 |
mwexec("/sbin/ifconfig " . escapeshellarg($ipsecif) . " {$inet} " . escapeshellarg($addr['left']) . " " . $right . $addr['alias']); |
|
1735 | 1735 |
/* If alias is empty, this is the first address on the interface and should be used as the gateway. */ |
1736 | 1736 |
if (empty($addr['alias'])) { |
1737 | 1737 |
file_put_contents("/tmp/{$ipsecif}_router{$gwtype}", $addr['right']); |
... | ... | |
2986 | 2986 |
$syncpeer = "-syncpeer"; |
2987 | 2987 |
} |
2988 | 2988 |
|
2989 |
mwexec("/sbin/ifconfig pfsync0 syncdev {$carp_sync_int} {$syncpeer} up", false);
|
|
2990 |
mwexec("/sbin/ifconfig pfsync0 -defer", false);
|
|
2989 |
mwexec("/sbin/ifconfig pfsync0 syncdev {$carp_sync_int} {$syncpeer} up"); |
|
2990 |
mwexec("/sbin/ifconfig pfsync0 -defer"); |
|
2991 | 2991 |
|
2992 | 2992 |
sleep(1); |
2993 | 2993 |
|
... | ... | |
3003 | 3003 |
log_error(sprintf(gettext("pfsync done in %s seconds."), $i)); |
3004 | 3004 |
log_error(gettext("Configuring CARP settings finalize...")); |
3005 | 3005 |
} else { |
3006 |
mwexec("/sbin/ifconfig pfsync0 -syncdev -syncpeer down", false);
|
|
3006 |
mwexec("/sbin/ifconfig pfsync0 -syncdev -syncpeer down"); |
|
3007 | 3007 |
} |
3008 | 3008 |
|
3009 | 3009 |
$carplist = get_configured_vip_list('all', VIP_CARP); |
... | ... | |
3843 | 3843 |
|
3844 | 3844 |
/* configure wireless */ |
3845 | 3845 |
$wlcmd_args = implode(" ", $wlcmd); |
3846 |
mwexec("/sbin/ifconfig " . escapeshellarg($if) . " " . $wlcmd_args, false);
|
|
3846 |
mwexec("/sbin/ifconfig " . escapeshellarg($if) . " " . $wlcmd_args); |
|
3847 | 3847 |
fwrite($wlan_setup_log, "/sbin/ifconfig " . escapeshellarg($if) . " " . "$wlcmd_args \n"); |
3848 | 3848 |
/* Bring the interface up only after setting up all the other parameters. */ |
3849 |
mwexec("/sbin/ifconfig " . escapeshellarg($if) . " up", false);
|
|
3849 |
mwexec("/sbin/ifconfig " . escapeshellarg($if) . " up"); |
|
3850 | 3850 |
fwrite($wlan_setup_log, "/sbin/ifconfig " . escapeshellarg($if) . " up\n"); |
3851 | 3851 |
fclose($wlan_setup_log); |
3852 | 3852 |
|
Also available in: Unified diff
mwexec() 2nd parameter default value is false. Remove it from caller