Skip to content

Instantly share code, notes, and snippets.

@CHTJonas
Last active July 27, 2021 09:12
Show Gist options
  • Save CHTJonas/6446c07a311dd8435d045a6d58712989 to your computer and use it in GitHub Desktop.
Save CHTJonas/6446c07a311dd8435d045a6d58712989 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -euo pipefail
rm -f /dev/shm/unbound.cache
trap "rm -f /dev/shm/unbound.cache" EXIT INT TERM HUP QUIT ILL TRAP BUS SEGV
/usr/sbin/unbound-checkconf
umask 0077
touch /dev/shm/unbound.cache
/usr/sbin/unbound-control dump_cache > /dev/shm/unbound.cache
/usr/sbin/unbound-control reload
/usr/sbin/unbound-control load_cache < /dev/shm/unbound.cache
rm /dev/shm/unbound.cache
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment