Skip to content

Instantly share code, notes, and snippets.

@Westie

Westie/fix.sh Secret

Created January 27, 2024 16:48
Show Gist options
  • Save Westie/5557cffd927dd32de93255e5ac4a22e0 to your computer and use it in GitHub Desktop.
Save Westie/5557cffd927dd32de93255e5ac4a22e0 to your computer and use it in GitHub Desktop.
Fix wireguard + DNS issues with opnsense
#!/bin/sh
SOURCE_PATH=$(realpath $0);
if [ -z "${SOURCE_PATH}" ]; then
exit 1
fi
run_delay () {
sh -c "(sleep 60 && ${SOURCE_PATH} fix) > /dev/null" &
}
run_fix () {
/usr/local/etc/rc.filter_configure
/usr/local/sbin/pluginctl -s unbound restart
/usr/local/sbin/pluginctl -s dnsmasq restart
/usr/local/sbin/pluginctl -s dhcpd restart
}
if [ -z "${1}" ]; then
run_delay
elif [ ! -z "${1}" -a "${1}" == "fix" ]; then
run_fix
fi
@Westie
Copy link
Author

Westie commented Feb 6, 2024

This will need to go in /usr/local/etc/rc.syshook.d/start/99-reload-rules or similar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment