#!/bin/sh
set -e

mkdir -p /usr/local/etc/pkg/repos/
echo 'dnssense: {  url: "https://portal.dnssense.com/packages/${ABI}",  enabled: yes}' >/usr/local/etc/pkg/repos/dnssense.conf
pkg update -fq -r dnssense
pkg install -y dnssense || exit 1
os=$(uname -i)

sysrc dnssense_enable=YES || exit 1

echo "servers=45.129.19.199,45.129.19.200,2a0e:3640::1111
url=https://portal.dnssense.com
ping=.dns0.org
attach_domain=.dns0.org
dont_touch_domains=.dnssense.com,.pfsense.org
" >/usr/local/etc/dnssense/dnssense.override.conf

echo "open management page and configure DnsSense service"
