Skip to content

Instantly share code, notes, and snippets.

@fvoges
Last active July 14, 2023 15:03
Show Gist options
  • Save fvoges/cfd57e8b3b9094bc1648c5125aeb045c to your computer and use it in GitHub Desktop.
Save fvoges/cfd57e8b3b9094bc1648c5125aeb045c to your computer and use it in GitHub Desktop.
UniFi UDM Pro SE custom DNS
#!/bin/bash
# Get DataDir location
DATA_DIR="/data"
case "$(ubnt-device-info firmware || true)" in
1*)
DATA_DIR="/mnt/data"
;;
2*)
DATA_DIR="/data"
;;
3*)
DATA_DIR="/data"
;;
*)
echo "ERROR: No persistent storage found." 1>&2
exit 1
;;
esac
## Places public keys in ~/.ssh/authorized_keys
DNSMASQ_SOURCE_FILE="${DATA_DIR}/on_boot.d/files/shadowsun.conf"
DNSMASQ_TARGET_FILE="/run/dnsmasq.conf.d/shadowsun.conf"
cp -f $DNSMASQ_SOURCE_FILE $DNSMASQ_TARGET_FILE
kill `cat /run/dnsmasq.pid`
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment