mirror of
https://github.com/RaspAP/raspap-webgui.git
synced 2024-11-25 00:50:29 +00:00
Update w/ fallback default values
This commit is contained in:
parent
1fddf4270b
commit
cc1c8d594a
1 changed files with 3 additions and 2 deletions
|
@ -50,6 +50,7 @@ function DisplayWireGuardConfig()
|
|||
$config[] = '[Interface]';
|
||||
$config[] = 'Address = '.$_POST['wg_ipaddress'];
|
||||
$config[] = 'ListenPort = '.$_POST['wg_port'];
|
||||
|
||||
$config[] = '';
|
||||
$config[] = 'PrivateKey = '.$_POST['wg_privkey'];
|
||||
$config[] = 'PostUp = iptables -A FORWARD -i %i -j ACCEPT; iptables -A FORWARD -o %i -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE';
|
||||
|
@ -102,8 +103,8 @@ function DisplayWireGuardConfig()
|
|||
// fetch wg config
|
||||
exec('sudo cat '. RASPI_WIREGUARD_CONFIG, $return);
|
||||
$conf = ParseConfig($return);
|
||||
$wg_port = $conf['ListenPort'];
|
||||
$wg_ipaddress = $conf['Address'];
|
||||
$wg_port = ($conf['ListenPort'] == '') ? getDefaultNetValue('wireguard','interface','listenport') : $conf['ListenPort'];
|
||||
$wg_ipaddress = ($conf['Address'] == '') ? getDefaultNetValue('wireguard','interface','address') : $conf['Address'];
|
||||
$wg_pubkey = $conf['PublicKey'];
|
||||
$wg_privkey = $conf['PrivateKey'];
|
||||
$wg_endpoint = $conf['Endpoint'];
|
||||
|
|
Loading…
Reference in a new issue