Merge pull request #1586 from RaspAP/fix/wireguard-conf

Fix: correctly parse multiple wg DNS entries
This commit is contained in:
Bill Zimmerman 2024-05-14 07:27:04 +02:00 committed by GitHub
commit 6541e9b2e1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -43,6 +43,9 @@ function DisplayWireGuardConfig()
$wg_srvport = ($conf['ListenPort'] == '') ? getDefaultNetValue('wireguard','server','ListenPort') : $conf['ListenPort'];
$wg_srvipaddress = ($conf['Address'] == '') ? getDefaultNetValue('wireguard','server','Address') : $conf['Address'];
$wg_srvdns = ($conf['DNS'] == '') ? getDefaultNetValue('wireguard','server','DNS') : $conf['DNS'];
if (is_array($wg_srvdns)) {
$wg_srvdns = implode(', ', $wg_srvdns);
}
$wg_peerpubkey = exec('sudo cat '. RASPI_WIREGUARD_PATH .'wg-peer-public.key', $return);
if (sizeof($conf) >0) {
$wg_senabled = true;