if["$global_dns" !="1.1.1.1"];then# Changing the DNS used for clients. Had to change it in 2 locations.
echo"Changing default dns..."
sed -i 's/^DNS = .*/DNS = ${global_dns}/' /etc/wireguard/wg0.conf
sed -i "s/^peer_global_dns = .*/peer_global_dns = $global_dns/" /opt/wireguardashboard/app/src/wg-dashboard.ini
fi
if["$public_ip" !="0.0.0.0"];then# Setting the public IP of the WireGuard Dashboard container host. If not defined, it will be tried using ifconfig.me.
sed -i "s/^remote_endpoint = .*/remote_endpoint = $public_ip/" /opt/wireguardashboard/app/src/wg-dashboard.ini
else
sed -i "s/^remote_endpoint = .*/remote_endpoint = $(curl ifconfig.me)/" /opt/wireguardashboard/app/src/wg-dashboard.ini