Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script not working in newest OPNsense version #1

Open
schossel opened this issue Jan 20, 2025 · 0 comments
Open

Script not working in newest OPNsense version #1

schossel opened this issue Jan 20, 2025 · 0 comments

Comments

@schossel
Copy link

In the newest version of opnsense, there are rolling openvpn log files.
The up/down doesnt't work anymore.

This code should fix it, but I don't know how to do a request:

case $1 in
add)    unbound-control -c /var/unbound/unbound.conf forward_add +i . \
        `cat "$(ls -t /var/log/openvpn/*.log | head -n 1)" | grep 'dhcp-option DNS' | tail -n 1 | awk -F'dhcp-option DNS ' '{for (i=2; i<=NF; i++) print $i}' | awk -F',' '{print $1}' | paste -sd' ' -`
;;

del)    unbound-control -c /var/unbound/unbound.conf forward_add +i . \
        `tail -n 2 /etc/resolv.conf | cut -f 2 -d " " | tr -s "\n" " "` 
;;

show)   unbound-control -c /var/unbound/unbound.conf lookup opnsense.org 
;;

put)    unbound-control -c /var/unbound/unbound.conf forward_add +i . $@
;;

*)      echo "Help: add|del|show|put [Nameserver]" 
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant