WireGuard Client config hotplug


First time posting here, new to the OpenWRT community and fairly new to the using OpenWRT firmware.

I've got a simple WireGuard Client config in place (using a commercial VPN provider) i.e. wireguard interface attached to the wan firewall zone.

I've got dns leak from my IPS as I've set my WAN to DNS as advertised by peer.

I do not want to set a static DNS (that all tutorials suggest), as it requires me to switch to my ISP DNS every time I need to turn off the VPN. Before moving to WireGuard, I had had OpenVPN setup with the following scripts:

cat << "EOF" > /etc/hotplug.d/net/00-openvpn-resolv
if [ "${INTERFACE%%[0-9]*}" = "tun" ]
then case "${ACTION}" in
(add) RESOLV_CONF="/tmp/resolv.conf.d/resolv.conf.vpn" ;;
(remove) RESOLV_CONF="/tmp/resolv.conf.d/resolv.conf.auto" ;;
uci set dhcp.@dnsmasq[0].resolvfile="${RESOLV_CONF}"
/etc/init.d/dnsmasq restart
cat << "EOF" > /etc/hotplug.d/openvpn/00-resolv
env | sed -n -e "
" | sort -u > /tmp/resolv.conf.d/resolv.conf.vpn
cat << "EOF" >> /etc/sysupgrade.conf
/etc/init.d/openvpn restart

Which allowed me to switch between VPN and ISP DNS seamlessly. I've found the scripts on the official docs

I am wondering if there is something similar I can do for my WireGuard setup? I've tried this same script for wireguard but it doesn't make any different whatsoever.

Thanks in advance!